// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "clickhouse.proto" (package "api", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { WorkflowExecutionResult } from "./shared";
import { ExtractColumnFormat } from "./shared";
import { TranslationMap } from "./shared";
import { BlockFilter } from "./shared";
import { QueryProjectHeader } from "./shared";
import { StringDateObject } from "./shared";
/**
 * @generated from protobuf message api.CHDimension
 */
export interface CHDimension {
    /**
     * @generated from protobuf field: string Name = 1 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: string Granularity = 2 [json_name = "Granularity"];
     */
    granularity: string;
    /**
     * @generated from protobuf field: string Level = 3 [json_name = "Level"];
     */
    level: string;
    /**
     * @generated from protobuf field: string DataType = 4 [json_name = "DataType"];
     */
    dataType: string;
    /**
     * @generated from protobuf field: string ContentType = 5 [json_name = "ContentType"];
     */
    contentType: string;
    /**
     * @generated from protobuf field: string EnumValues = 6 [json_name = "EnumValues"];
     */
    enumValues: string;
    /**
     * A period of time
     *
     * @generated from protobuf field: string Period = 7 [json_name = "Period"];
     */
    period: string;
    /**
     * Allowed values : \"\", \"EQUAL\", \"DIFF\", \"START_BY\", \"NOT_START_BY\", \"FINISH_BY\", \"NOT_FINISH_BY\", \"CONTAINS\", \"NOT_CONTAINS\", \"IN_LIST\", \"NOT_IN_LIST\"
     *
     * @generated from protobuf field: string Operator = 8 [json_name = "Operator"];
     */
    operator: string;
    /**
     * @generated from protobuf field: repeated string Values = 9 [json_name = "Values"];
     */
    values: string[];
    /**
     * @generated from protobuf field: api.StringDateObject StartDate = 10 [json_name = "StartDate"];
     */
    startDate?: StringDateObject;
    /**
     * @generated from protobuf field: api.StringDateObject EndDate = 11 [json_name = "EndDate"];
     */
    endDate?: StringDateObject;
    /**
     * @generated from protobuf field: repeated api.CHQueryExpression Expressions = 12 [json_name = "Expressions"];
     */
    expressions: CHQueryExpression[];
    /**
     * @generated from protobuf field: bool IsComputed = 13 [json_name = "IsComputed"];
     */
    isComputed: boolean;
    /**
     * Only useful for filters
     *
     * @generated from protobuf field: api.CHDimension Or = 14 [json_name = "Or"];
     */
    or?: CHDimension;
}
/**
 * @generated from protobuf message api.CHQueryExpression
 */
export interface CHQueryExpression {
    /**
     * @generated from protobuf field: string Block = 1 [json_name = "Block"];
     */
    block: string;
    /**
     * @generated from protobuf field: api.CHQueryType QueryType = 2 [json_name = "QueryType"];
     */
    queryType: CHQueryType;
    /**
     * @generated from protobuf field: string Field = 3 [json_name = "Field"];
     */
    field: string;
    /**
     * @generated from protobuf field: string Query = 4 [json_name = "Query"];
     */
    query: string;
}
/**
 * @generated from protobuf message api.CHMetric
 */
export interface CHMetric {
    /**
     * @generated from protobuf field: string Name = 1 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: string Level = 3 [json_name = "Level"];
     */
    level: string;
    /**
     * @generated from protobuf field: string DataType = 4 [json_name = "DataType"];
     */
    dataType: string;
    /**
     * @generated from protobuf field: string ContentType = 5 [json_name = "ContentType"];
     */
    contentType: string;
    /**
     * @generated from protobuf field: string EnumValues = 6 [json_name = "EnumValues"];
     */
    enumValues: string;
    /**
     * @generated from protobuf field: repeated api.CHQueryExpression Expressions = 12 [json_name = "Expressions"];
     */
    expressions: CHQueryExpression[];
    /**
     * @generated from protobuf field: bool IsComputed = 13 [json_name = "IsComputed"];
     */
    isComputed: boolean;
}
/**
 * @generated from protobuf message api.CHFilter
 */
export interface CHFilter {
    /**
     * @generated from protobuf field: repeated api.CHDimension Dimensions = 1 [json_name = "Dimensions"];
     */
    dimensions: CHDimension[];
}
// 
// GetKpiData Api messages

/**
 * @generated from protobuf message api.KpiDataSerie
 */
export interface KpiDataSerie {
    /**
     * @generated from protobuf field: string Name = 1 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: repeated string Values = 2 [json_name = "Values"];
     */
    values: string[];
}
/**
 * @generated from protobuf message api.GetKPIDataQuery
 */
export interface GetKPIDataQuery {
    /**
     * @generated from protobuf field: api.QueryProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: QueryProjectHeader;
    /**
     * @generated from protobuf field: api.CHChartType ChartType = 2 [json_name = "ChartType"];
     */
    chartType: CHChartType;
    /**
     * @generated from protobuf field: api.CHQueryType QueryType = 3 [json_name = "QueryType"];
     */
    queryType: CHQueryType;
    /**
     * @generated from protobuf field: string QueryBlock = 4 [json_name = "QueryBlock"];
     */
    queryBlock: string;
    /**
     * @generated from protobuf field: repeated api.CHDimension Dimensions = 5 [json_name = "Dimensions"];
     */
    dimensions: CHDimension[];
    /**
     * @generated from protobuf field: repeated api.CHMetric Metrics = 6 [json_name = "Metrics"];
     */
    metrics: CHMetric[];
    /**
     * @generated from protobuf field: api.CHFilter Filter = 7 [json_name = "Filter"];
     */
    filter?: CHFilter;
    /**
     * @generated from protobuf field: string TargetTimeZone = 8 [json_name = "TargetTimeZone"];
     */
    targetTimeZone: string;
    /**
     * @generated from protobuf field: api.KpiDataResultFormat ResultFormat = 9 [json_name = "ResultFormat"];
     */
    resultFormat: KpiDataResultFormat;
    /**
     * @generated from protobuf field: string KpiGroupName = 10 [json_name = "KpiGroupName"];
     */
    kpiGroupName: string;
}
/**
 * @generated from protobuf message api.GetKPIDataForUserQuery
 */
export interface GetKPIDataForUserQuery {
    /**
     * @generated from protobuf field: string ProjectID = 1 [json_name = "ProjectID"];
     */
    projectID: string;
    /**
     * @generated from protobuf field: api.CHChartType ChartType = 2 [json_name = "ChartType"];
     */
    chartType: CHChartType;
    /**
     * @generated from protobuf field: api.CHQueryType QueryType = 3 [json_name = "QueryType"];
     */
    queryType: CHQueryType;
    /**
     * @generated from protobuf field: string QueryBlock = 4 [json_name = "QueryBlock"];
     */
    queryBlock: string;
    /**
     * @generated from protobuf field: repeated api.CHDimension Dimensions = 5 [json_name = "Dimensions"];
     */
    dimensions: CHDimension[];
    /**
     * @generated from protobuf field: repeated api.CHMetric Metrics = 6 [json_name = "Metrics"];
     */
    metrics: CHMetric[];
    /**
     * @generated from protobuf field: api.CHFilter Filter = 7 [json_name = "Filter"];
     */
    filter?: CHFilter;
    /**
     * @generated from protobuf field: string TargetTimeZone = 8 [json_name = "TargetTimeZone"];
     */
    targetTimeZone: string;
    /**
     * @generated from protobuf field: api.KpiDataResultFormat ResultFormat = 9 [json_name = "ResultFormat"];
     */
    resultFormat: KpiDataResultFormat;
    /**
     * @generated from protobuf field: string KpiGroupName = 10 [json_name = "KpiGroupName"];
     */
    kpiGroupName: string;
    /**
     * @generated from protobuf field: string UserID = 11 [json_name = "UserID"];
     */
    userID: string;
    /**
     * Number of elements displayed
     *
     * @generated from protobuf field: string PagingState = 12 [json_name = "PagingState"];
     */
    pagingState: string;
    /**
     * Number of additional elements to display
     *
     * @generated from protobuf field: string Limit = 13 [json_name = "Limit"];
     */
    limit: string;
}
/**
 * @generated from protobuf message api.GetKPIDataResult
 */
export interface GetKPIDataResult {
    /**
     * @generated from protobuf field: string Results = 1 [json_name = "Results"];
     */
    results: string;
    /**
     * @generated from protobuf field: repeated api.KpiDataSerie Series = 2 [json_name = "Series"];
     */
    series: KpiDataSerie[];
}
/**
 * @generated from protobuf message api.EntityBlockFilter
 */
export interface EntityBlockFilter {
    /**
     * @generated from protobuf field: string EntityName = 1 [json_name = "EntityName"];
     */
    entityName: string;
    /**
     * @generated from protobuf field: repeated api.BlockFilter BlockFilters = 2 [json_name = "BlockFilters"];
     */
    blockFilters: BlockFilter[];
}
/**
 * @generated from protobuf message api.FindKPIDataQuery
 */
export interface FindKPIDataQuery {
    /**
     * @generated from protobuf field: api.QueryProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: QueryProjectHeader;
    /**
     * TODO really useful ??
     *
     * @generated from protobuf field: api.CHQueryType QueryType = 2 [json_name = "QueryType"];
     */
    queryType: CHQueryType;
    /**
     * TODO Really useful ??
     *
     * @generated from protobuf field: string QueryBlock = 3 [json_name = "QueryBlock"];
     */
    queryBlock: string;
    /**
     * list of blockFilters structure for Find query, each element (BlockFilter) in the list is an "OR" part of the query
     *
     * @generated from protobuf field: repeated api.EntityBlockFilter EntityBlockFilters = 4 [json_name = "EntityBlockFilters"];
     */
    entityBlockFilters: EntityBlockFilter[];
    /**
     * @generated from protobuf field: api.CHFilter Filter = 5 [json_name = "Filter"];
     */
    filter?: CHFilter;
    /**
     * @generated from protobuf field: repeated api.CHDimension Dimensions = 6 [json_name = "Dimensions"];
     */
    dimensions: CHDimension[];
    /**
     * @generated from protobuf field: repeated api.CHMetric Metrics = 7 [json_name = "Metrics"];
     */
    metrics: CHMetric[];
    /**
     * @generated from protobuf field: string TargetTimeZone = 8 [json_name = "TargetTimeZone"];
     */
    targetTimeZone: string;
    /**
     * @generated from protobuf field: string KpiGroupName = 9 [json_name = "KpiGroupName"];
     */
    kpiGroupName: string;
}
/**
 * @generated from protobuf message api.FindKPIDataResult
 */
export interface FindKPIDataResult {
    /**
     * @generated from protobuf field: repeated api.KpiDataSerie Series = 1 [json_name = "Series"];
     */
    series: KpiDataSerie[];
}
/**
 * @generated from protobuf message api.ExtractKPIQuery
 */
export interface ExtractKPIQuery {
    /**
     * @generated from protobuf field: api.QueryProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: QueryProjectHeader;
    /**
     * @generated from protobuf field: string UserId = 2 [json_name = "UserId"];
     */
    userId: string;
    /**
     * @generated from protobuf field: api.CHQueryType QueryType = 3 [json_name = "QueryType"];
     */
    queryType: CHQueryType;
    /**
     * @generated from protobuf field: string QueryBlock = 4 [json_name = "QueryBlock"];
     */
    queryBlock: string;
    /**
     * @generated from protobuf field: repeated api.EntityBlockFilter EntityBlockFilters = 5 [json_name = "EntityBlockFilters"];
     */
    entityBlockFilters: EntityBlockFilter[];
    /**
     * @generated from protobuf field: api.CHFilter Filter = 6 [json_name = "Filter"];
     */
    filter?: CHFilter;
    /**
     * @generated from protobuf field: repeated api.CHDimension Dimensions = 7 [json_name = "Dimensions"];
     */
    dimensions: CHDimension[];
    /**
     * @generated from protobuf field: repeated api.CHMetric Metrics = 8 [json_name = "Metrics"];
     */
    metrics: CHMetric[];
    /**
     * @generated from protobuf field: string TargetTimeZone = 9 [json_name = "TargetTimeZone"];
     */
    targetTimeZone: string;
    /**
     * @generated from protobuf field: string KpiGroupName = 10 [json_name = "KpiGroupName"];
     */
    kpiGroupName: string;
    /**
     * @generated from protobuf field: string TargetDomain = 11 [json_name = "TargetDomain"];
     */
    targetDomain: string;
    /**
     * @generated from protobuf field: string TargetType = 12 [json_name = "TargetType"];
     */
    targetType: string;
    /**
     * @generated from protobuf field: repeated string Fields = 13 [json_name = "Fields"];
     */
    fields: string[];
    /**
     * @generated from protobuf field: string ListSeparator = 14 [json_name = "ListSeparator"];
     */
    listSeparator: string;
    /**
     * @generated from protobuf field: string DecimalSeparator = 15 [json_name = "DecimalSeparator"];
     */
    decimalSeparator: string;
    /**
     * @generated from protobuf field: repeated string ColumnNames = 16 [json_name = "ColumnNames"];
     */
    columnNames: string[];
    /**
     * @generated from protobuf field: map<string, api.TranslationMap> ColumnTranslationMaps = 17 [json_name = "ColumnTranslationMaps"];
     */
    columnTranslationMaps: {
        [key: string]: TranslationMap;
    };
    /**
     * @generated from protobuf field: repeated int32 FieldIdxLVDetailedQuantity = 18 [json_name = "FieldIdxLVDetailedQuantity"];
     */
    fieldIdxLVDetailedQuantity: number[];
    /**
     * @generated from protobuf field: map<int32, api.ExtractColumnFormat> ColumnFormats = 19 [json_name = "ColumnFormats"];
     */
    columnFormats: {
        [key: number]: ExtractColumnFormat;
    };
}
/**
 * @generated from protobuf message api.ExtractKPIResult
 */
export interface ExtractKPIResult {
    /**
     * @generated from protobuf field: api.WorkflowExecutionResult WorkflowExecution = 1 [json_name = "WorkflowExecution"];
     */
    workflowExecution?: WorkflowExecutionResult;
}
/**
 * @generated from protobuf enum api.CHChartType
 */
export enum CHChartType {
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_UNKNOWN = 0;
     */
    CH_CHART_TYPE_UNKNOWN = 0,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_LINE_CHART = 1;
     */
    CH_CHART_TYPE_LINE_CHART = 1,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_MULTI_LINE_CHART = 2;
     */
    CH_CHART_TYPE_MULTI_LINE_CHART = 2,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_VERTICAL_BAR_CHART = 3;
     */
    CH_CHART_TYPE_VERTICAL_BAR_CHART = 3,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_HORIZONTAL_BAR_CHART = 4;
     */
    CH_CHART_TYPE_HORIZONTAL_BAR_CHART = 4,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_STACKED_BAR_CHART = 5;
     */
    CH_CHART_TYPE_STACKED_BAR_CHART = 5,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_PIE_CHART = 6;
     */
    CH_CHART_TYPE_PIE_CHART = 6,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_DOUGHNUT_CHART = 7;
     */
    CH_CHART_TYPE_DOUGHNUT_CHART = 7,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_METRIC = 8;
     */
    CH_CHART_TYPE_METRIC = 8,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_TABLE = 9;
     */
    CH_CHART_TYPE_TABLE = 9,
    /**
     * @generated from protobuf enum value: CH_CHART_TYPE_PIVOT_TABLE = 10;
     */
    CH_CHART_TYPE_PIVOT_TABLE = 10
}
/**
 * @generated from protobuf enum api.CHQueryType
 */
export enum CHQueryType {
    /**
     * @generated from protobuf enum value: CH_QUERY_TYPE_UNKNOWN = 0;
     */
    CH_QUERY_TYPE_UNKNOWN = 0,
    /**
     * @generated from protobuf enum value: CH_QUERY_TYPE_A = 1;
     */
    CH_QUERY_TYPE_A = 1,
    /**
     * @generated from protobuf enum value: CH_QUERY_TYPE_B = 2;
     */
    CH_QUERY_TYPE_B = 2,
    /**
     * @generated from protobuf enum value: CH_QUERY_TYPE_C = 3;
     */
    CH_QUERY_TYPE_C = 3
}
/**
 * @generated from protobuf enum api.KpiDataResultFormat
 */
export enum KpiDataResultFormat {
    /**
     * @generated from protobuf enum value: KPIDATA_RESULT_FORMAT_RAW = 0;
     */
    KPIDATA_RESULT_FORMAT_RAW = 0,
    /**
     * @generated from protobuf enum value: KPIDATA_RESULT_FORMAT_SERIES = 1;
     */
    KPIDATA_RESULT_FORMAT_SERIES = 1
}
// @generated message type with reflection information, may provide speed optimized methods
class CHDimension$Type extends MessageType<CHDimension> {
    constructor() {
        super("api.CHDimension", [
            { no: 1, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 2, name: "Granularity", kind: "scalar", jsonName: "Granularity", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "Level", kind: "scalar", jsonName: "Level", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 4, name: "DataType", kind: "scalar", jsonName: "DataType", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"date\"" } } },
            { no: 5, name: "ContentType", kind: "scalar", jsonName: "ContentType", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"DateTime\"" } } },
            { no: 6, name: "EnumValues", kind: "scalar", jsonName: "EnumValues", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "Period", kind: "scalar", jsonName: "Period", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "A period of time" } } },
            { no: 8, name: "Operator", kind: "scalar", jsonName: "Operator", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Allowed values : \"\", \"EQUAL\", \"DIFF\", \"START_BY\", \"NOT_START_BY\", \"FINISH_BY\", \"NOT_FINISH_BY\", \"CONTAINS\", \"NOT_CONTAINS\", \"IN_LIST\", \"NOT_IN_LIST\"" } } },
            { no: 9, name: "Values", kind: "scalar", jsonName: "Values", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 10, name: "StartDate", kind: "message", jsonName: "StartDate", T: () => StringDateObject },
            { no: 11, name: "EndDate", kind: "message", jsonName: "EndDate", T: () => StringDateObject },
            { no: 12, name: "Expressions", kind: "message", jsonName: "Expressions", repeat: 1 /*RepeatType.PACKED*/, T: () => CHQueryExpression },
            { no: 13, name: "IsComputed", kind: "scalar", jsonName: "IsComputed", T: 8 /*ScalarType.BOOL*/ },
            { no: 14, name: "Or", kind: "message", jsonName: "Or", T: () => CHDimension }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name", "Level", "DataType", "ContentType"] } } });
    }
    create(value?: PartialMessage<CHDimension>): CHDimension {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.name = "";
        message.granularity = "";
        message.level = "";
        message.dataType = "";
        message.contentType = "";
        message.enumValues = "";
        message.period = "";
        message.operator = "";
        message.values = [];
        message.expressions = [];
        message.isComputed = false;
        if (value !== undefined)
            reflectionMergePartial<CHDimension>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CHDimension): CHDimension {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Name = 1 [json_name = "Name"];*/ 1:
                    message.name = reader.string();
                    break;
                case /* string Granularity = 2 [json_name = "Granularity"];*/ 2:
                    message.granularity = reader.string();
                    break;
                case /* string Level = 3 [json_name = "Level"];*/ 3:
                    message.level = reader.string();
                    break;
                case /* string DataType = 4 [json_name = "DataType"];*/ 4:
                    message.dataType = reader.string();
                    break;
                case /* string ContentType = 5 [json_name = "ContentType"];*/ 5:
                    message.contentType = reader.string();
                    break;
                case /* string EnumValues = 6 [json_name = "EnumValues"];*/ 6:
                    message.enumValues = reader.string();
                    break;
                case /* string Period = 7 [json_name = "Period"];*/ 7:
                    message.period = reader.string();
                    break;
                case /* string Operator = 8 [json_name = "Operator"];*/ 8:
                    message.operator = reader.string();
                    break;
                case /* repeated string Values = 9 [json_name = "Values"];*/ 9:
                    message.values.push(reader.string());
                    break;
                case /* api.StringDateObject StartDate = 10 [json_name = "StartDate"];*/ 10:
                    message.startDate = StringDateObject.internalBinaryRead(reader, reader.uint32(), options, message.startDate);
                    break;
                case /* api.StringDateObject EndDate = 11 [json_name = "EndDate"];*/ 11:
                    message.endDate = StringDateObject.internalBinaryRead(reader, reader.uint32(), options, message.endDate);
                    break;
                case /* repeated api.CHQueryExpression Expressions = 12 [json_name = "Expressions"];*/ 12:
                    message.expressions.push(CHQueryExpression.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* bool IsComputed = 13 [json_name = "IsComputed"];*/ 13:
                    message.isComputed = reader.bool();
                    break;
                case /* api.CHDimension Or = 14 [json_name = "Or"];*/ 14:
                    message.or = CHDimension.internalBinaryRead(reader, reader.uint32(), options, message.or);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: CHDimension, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Name = 1 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.name);
        /* string Granularity = 2 [json_name = "Granularity"]; */
        if (message.granularity !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.granularity);
        /* string Level = 3 [json_name = "Level"]; */
        if (message.level !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.level);
        /* string DataType = 4 [json_name = "DataType"]; */
        if (message.dataType !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.dataType);
        /* string ContentType = 5 [json_name = "ContentType"]; */
        if (message.contentType !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.contentType);
        /* string EnumValues = 6 [json_name = "EnumValues"]; */
        if (message.enumValues !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.enumValues);
        /* string Period = 7 [json_name = "Period"]; */
        if (message.period !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.period);
        /* string Operator = 8 [json_name = "Operator"]; */
        if (message.operator !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.operator);
        /* repeated string Values = 9 [json_name = "Values"]; */
        for (let i = 0; i < message.values.length; i++)
            writer.tag(9, WireType.LengthDelimited).string(message.values[i]);
        /* api.StringDateObject StartDate = 10 [json_name = "StartDate"]; */
        if (message.startDate)
            StringDateObject.internalBinaryWrite(message.startDate, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
        /* api.StringDateObject EndDate = 11 [json_name = "EndDate"]; */
        if (message.endDate)
            StringDateObject.internalBinaryWrite(message.endDate, writer.tag(11, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.CHQueryExpression Expressions = 12 [json_name = "Expressions"]; */
        for (let i = 0; i < message.expressions.length; i++)
            CHQueryExpression.internalBinaryWrite(message.expressions[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join();
        /* bool IsComputed = 13 [json_name = "IsComputed"]; */
        if (message.isComputed !== false)
            writer.tag(13, WireType.Varint).bool(message.isComputed);
        /* api.CHDimension Or = 14 [json_name = "Or"]; */
        if (message.or)
            CHDimension.internalBinaryWrite(message.or, writer.tag(14, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.CHDimension
 */
export const CHDimension = new CHDimension$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CHQueryExpression$Type extends MessageType<CHQueryExpression> {
    constructor() {
        super("api.CHQueryExpression", [
            { no: 1, name: "Block", kind: "scalar", jsonName: "Block", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "QueryType", kind: "enum", jsonName: "QueryType", T: () => ["api.CHQueryType", CHQueryType] },
            { no: 3, name: "Field", kind: "scalar", jsonName: "Field", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "Query", kind: "scalar", jsonName: "Query", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<CHQueryExpression>): CHQueryExpression {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.block = "";
        message.queryType = 0;
        message.field = "";
        message.query = "";
        if (value !== undefined)
            reflectionMergePartial<CHQueryExpression>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CHQueryExpression): CHQueryExpression {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Block = 1 [json_name = "Block"];*/ 1:
                    message.block = reader.string();
                    break;
                case /* api.CHQueryType QueryType = 2 [json_name = "QueryType"];*/ 2:
                    message.queryType = reader.int32();
                    break;
                case /* string Field = 3 [json_name = "Field"];*/ 3:
                    message.field = reader.string();
                    break;
                case /* string Query = 4 [json_name = "Query"];*/ 4:
                    message.query = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: CHQueryExpression, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Block = 1 [json_name = "Block"]; */
        if (message.block !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.block);
        /* api.CHQueryType QueryType = 2 [json_name = "QueryType"]; */
        if (message.queryType !== 0)
            writer.tag(2, WireType.Varint).int32(message.queryType);
        /* string Field = 3 [json_name = "Field"]; */
        if (message.field !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.field);
        /* string Query = 4 [json_name = "Query"]; */
        if (message.query !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.query);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.CHQueryExpression
 */
export const CHQueryExpression = new CHQueryExpression$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CHMetric$Type extends MessageType<CHMetric> {
    constructor() {
        super("api.CHMetric", [
            { no: 1, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 3, name: "Level", kind: "scalar", jsonName: "Level", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 4, name: "DataType", kind: "scalar", jsonName: "DataType", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"count\"" } } },
            { no: 5, name: "ContentType", kind: "scalar", jsonName: "ContentType", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"int\"" } } },
            { no: 6, name: "EnumValues", kind: "scalar", jsonName: "EnumValues", T: 9 /*ScalarType.STRING*/ },
            { no: 12, name: "Expressions", kind: "message", jsonName: "Expressions", repeat: 1 /*RepeatType.PACKED*/, T: () => CHQueryExpression },
            { no: 13, name: "IsComputed", kind: "scalar", jsonName: "IsComputed", T: 8 /*ScalarType.BOOL*/ }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name", "Level", "DataType", "ContentType"] } } });
    }
    create(value?: PartialMessage<CHMetric>): CHMetric {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.name = "";
        message.level = "";
        message.dataType = "";
        message.contentType = "";
        message.enumValues = "";
        message.expressions = [];
        message.isComputed = false;
        if (value !== undefined)
            reflectionMergePartial<CHMetric>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CHMetric): CHMetric {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Name = 1 [json_name = "Name"];*/ 1:
                    message.name = reader.string();
                    break;
                case /* string Level = 3 [json_name = "Level"];*/ 3:
                    message.level = reader.string();
                    break;
                case /* string DataType = 4 [json_name = "DataType"];*/ 4:
                    message.dataType = reader.string();
                    break;
                case /* string ContentType = 5 [json_name = "ContentType"];*/ 5:
                    message.contentType = reader.string();
                    break;
                case /* string EnumValues = 6 [json_name = "EnumValues"];*/ 6:
                    message.enumValues = reader.string();
                    break;
                case /* repeated api.CHQueryExpression Expressions = 12 [json_name = "Expressions"];*/ 12:
                    message.expressions.push(CHQueryExpression.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* bool IsComputed = 13 [json_name = "IsComputed"];*/ 13:
                    message.isComputed = reader.bool();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: CHMetric, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Name = 1 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.name);
        /* string Level = 3 [json_name = "Level"]; */
        if (message.level !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.level);
        /* string DataType = 4 [json_name = "DataType"]; */
        if (message.dataType !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.dataType);
        /* string ContentType = 5 [json_name = "ContentType"]; */
        if (message.contentType !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.contentType);
        /* string EnumValues = 6 [json_name = "EnumValues"]; */
        if (message.enumValues !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.enumValues);
        /* repeated api.CHQueryExpression Expressions = 12 [json_name = "Expressions"]; */
        for (let i = 0; i < message.expressions.length; i++)
            CHQueryExpression.internalBinaryWrite(message.expressions[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join();
        /* bool IsComputed = 13 [json_name = "IsComputed"]; */
        if (message.isComputed !== false)
            writer.tag(13, WireType.Varint).bool(message.isComputed);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.CHMetric
 */
export const CHMetric = new CHMetric$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CHFilter$Type extends MessageType<CHFilter> {
    constructor() {
        super("api.CHFilter", [
            { no: 1, name: "Dimensions", kind: "message", jsonName: "Dimensions", repeat: 1 /*RepeatType.PACKED*/, T: () => CHDimension }
        ]);
    }
    create(value?: PartialMessage<CHFilter>): CHFilter {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.dimensions = [];
        if (value !== undefined)
            reflectionMergePartial<CHFilter>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CHFilter): CHFilter {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.CHDimension Dimensions = 1 [json_name = "Dimensions"];*/ 1:
                    message.dimensions.push(CHDimension.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: CHFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.CHDimension Dimensions = 1 [json_name = "Dimensions"]; */
        for (let i = 0; i < message.dimensions.length; i++)
            CHDimension.internalBinaryWrite(message.dimensions[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.CHFilter
 */
export const CHFilter = new CHFilter$Type();
// @generated message type with reflection information, may provide speed optimized methods
class KpiDataSerie$Type extends MessageType<KpiDataSerie> {
    constructor() {
        super("api.KpiDataSerie", [
            { no: 1, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "Values", kind: "scalar", jsonName: "Values", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<KpiDataSerie>): KpiDataSerie {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.name = "";
        message.values = [];
        if (value !== undefined)
            reflectionMergePartial<KpiDataSerie>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: KpiDataSerie): KpiDataSerie {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Name = 1 [json_name = "Name"];*/ 1:
                    message.name = reader.string();
                    break;
                case /* repeated string Values = 2 [json_name = "Values"];*/ 2:
                    message.values.push(reader.string());
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: KpiDataSerie, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Name = 1 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.name);
        /* repeated string Values = 2 [json_name = "Values"]; */
        for (let i = 0; i < message.values.length; i++)
            writer.tag(2, WireType.LengthDelimited).string(message.values[i]);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.KpiDataSerie
 */
export const KpiDataSerie = new KpiDataSerie$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetKPIDataQuery$Type extends MessageType<GetKPIDataQuery> {
    constructor() {
        super("api.GetKPIDataQuery", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => QueryProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ChartType", kind: "enum", jsonName: "ChartType", T: () => ["api.CHChartType", CHChartType], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 3, name: "QueryType", kind: "enum", jsonName: "QueryType", T: () => ["api.CHQueryType", CHQueryType], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 4, name: "QueryBlock", kind: "scalar", jsonName: "QueryBlock", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 5, name: "Dimensions", kind: "message", jsonName: "Dimensions", repeat: 1 /*RepeatType.PACKED*/, T: () => CHDimension },
            { no: 6, name: "Metrics", kind: "message", jsonName: "Metrics", repeat: 1 /*RepeatType.PACKED*/, T: () => CHMetric },
            { no: 7, name: "Filter", kind: "message", jsonName: "Filter", T: () => CHFilter },
            { no: 8, name: "TargetTimeZone", kind: "scalar", jsonName: "TargetTimeZone", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1", tzData: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Target user time zone  <a href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>format</a>", example: "\"Europe/Paris\"" } } },
            { no: 9, name: "ResultFormat", kind: "enum", jsonName: "ResultFormat", T: () => ["api.KpiDataResultFormat", KpiDataResultFormat], options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Result format selection", example: "\"KPIDATA_RESULT_FORMAT_SERIES\"" } } },
            { no: 10, name: "KpiGroupName", kind: "scalar", jsonName: "KpiGroupName", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { in: ["executionflow", "stock", "movement", "handlingunit", "actor", "item", "stock_extended", "claim"] } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Name of the analysis criterion to get the kpi data from", example: "\"executionflow\"" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "ChartType", "QueryType", "QueryBlock", "Metrics", "KpiGroupName"] } } });
    }
    create(value?: PartialMessage<GetKPIDataQuery>): GetKPIDataQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.chartType = 0;
        message.queryType = 0;
        message.queryBlock = "";
        message.dimensions = [];
        message.metrics = [];
        message.targetTimeZone = "";
        message.resultFormat = 0;
        message.kpiGroupName = "";
        if (value !== undefined)
            reflectionMergePartial<GetKPIDataQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetKPIDataQuery): GetKPIDataQuery {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.QueryProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = QueryProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.CHChartType ChartType = 2 [json_name = "ChartType"];*/ 2:
                    message.chartType = reader.int32();
                    break;
                case /* api.CHQueryType QueryType = 3 [json_name = "QueryType"];*/ 3:
                    message.queryType = reader.int32();
                    break;
                case /* string QueryBlock = 4 [json_name = "QueryBlock"];*/ 4:
                    message.queryBlock = reader.string();
                    break;
                case /* repeated api.CHDimension Dimensions = 5 [json_name = "Dimensions"];*/ 5:
                    message.dimensions.push(CHDimension.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated api.CHMetric Metrics = 6 [json_name = "Metrics"];*/ 6:
                    message.metrics.push(CHMetric.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* api.CHFilter Filter = 7 [json_name = "Filter"];*/ 7:
                    message.filter = CHFilter.internalBinaryRead(reader, reader.uint32(), options, message.filter);
                    break;
                case /* string TargetTimeZone = 8 [json_name = "TargetTimeZone"];*/ 8:
                    message.targetTimeZone = reader.string();
                    break;
                case /* api.KpiDataResultFormat ResultFormat = 9 [json_name = "ResultFormat"];*/ 9:
                    message.resultFormat = reader.int32();
                    break;
                case /* string KpiGroupName = 10 [json_name = "KpiGroupName"];*/ 10:
                    message.kpiGroupName = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: GetKPIDataQuery, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.QueryProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            QueryProjectHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.CHChartType ChartType = 2 [json_name = "ChartType"]; */
        if (message.chartType !== 0)
            writer.tag(2, WireType.Varint).int32(message.chartType);
        /* api.CHQueryType QueryType = 3 [json_name = "QueryType"]; */
        if (message.queryType !== 0)
            writer.tag(3, WireType.Varint).int32(message.queryType);
        /* string QueryBlock = 4 [json_name = "QueryBlock"]; */
        if (message.queryBlock !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.queryBlock);
        /* repeated api.CHDimension Dimensions = 5 [json_name = "Dimensions"]; */
        for (let i = 0; i < message.dimensions.length; i++)
            CHDimension.internalBinaryWrite(message.dimensions[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.CHMetric Metrics = 6 [json_name = "Metrics"]; */
        for (let i = 0; i < message.metrics.length; i++)
            CHMetric.internalBinaryWrite(message.metrics[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* api.CHFilter Filter = 7 [json_name = "Filter"]; */
        if (message.filter)
            CHFilter.internalBinaryWrite(message.filter, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* string TargetTimeZone = 8 [json_name = "TargetTimeZone"]; */
        if (message.targetTimeZone !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.targetTimeZone);
        /* api.KpiDataResultFormat ResultFormat = 9 [json_name = "ResultFormat"]; */
        if (message.resultFormat !== 0)
            writer.tag(9, WireType.Varint).int32(message.resultFormat);
        /* string KpiGroupName = 10 [json_name = "KpiGroupName"]; */
        if (message.kpiGroupName !== "")
            writer.tag(10, WireType.LengthDelimited).string(message.kpiGroupName);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetKPIDataQuery
 */
export const GetKPIDataQuery = new GetKPIDataQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetKPIDataForUserQuery$Type extends MessageType<GetKPIDataForUserQuery> {
    constructor() {
        super("api.GetKPIDataForUserQuery", [
            { no: 1, name: "ProjectID", kind: "scalar", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 2, name: "ChartType", kind: "enum", jsonName: "ChartType", T: () => ["api.CHChartType", CHChartType], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 3, name: "QueryType", kind: "enum", jsonName: "QueryType", T: () => ["api.CHQueryType", CHQueryType], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 4, name: "QueryBlock", kind: "scalar", jsonName: "QueryBlock", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 5, name: "Dimensions", kind: "message", jsonName: "Dimensions", repeat: 1 /*RepeatType.PACKED*/, T: () => CHDimension },
            { no: 6, name: "Metrics", kind: "message", jsonName: "Metrics", repeat: 1 /*RepeatType.PACKED*/, T: () => CHMetric },
            { no: 7, name: "Filter", kind: "message", jsonName: "Filter", T: () => CHFilter },
            { no: 8, name: "TargetTimeZone", kind: "scalar", jsonName: "TargetTimeZone", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1", tzData: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Target user time zone  <a href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>format</a>", example: "\"Europe/Paris\"" } } },
            { no: 9, name: "ResultFormat", kind: "enum", jsonName: "ResultFormat", T: () => ["api.KpiDataResultFormat", KpiDataResultFormat], options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Result format selection", example: "\"KPIDATA_RESULT_FORMAT_SERIES\"" } } },
            { no: 10, name: "KpiGroupName", kind: "scalar", jsonName: "KpiGroupName", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { in: ["executionflow", "stock", "movement", "handlingunit", "actor", "item", "stock_extended", "claim"] } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Name of the analysis criterion to get the kpi data from", example: "\"executionflow\"" } } },
            { no: 11, name: "UserID", kind: "scalar", jsonName: "UserID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 12, name: "PagingState", kind: "scalar", jsonName: "PagingState", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Start position of the query result page. Pagination disabled if equal to -1.", example: "\"50\"" } } },
            { no: 13, name: "Limit", kind: "scalar", jsonName: "Limit", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Length of the query result page", example: "\"50\"" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["ProjectID", "ChartType", "QueryType", "QueryBlock", "Metrics", "KpiGroupName", "UserID"] } } });
    }
    create(value?: PartialMessage<GetKPIDataForUserQuery>): GetKPIDataForUserQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.projectID = "";
        message.chartType = 0;
        message.queryType = 0;
        message.queryBlock = "";
        message.dimensions = [];
        message.metrics = [];
        message.targetTimeZone = "";
        message.resultFormat = 0;
        message.kpiGroupName = "";
        message.userID = "";
        message.pagingState = "";
        message.limit = "";
        if (value !== undefined)
            reflectionMergePartial<GetKPIDataForUserQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetKPIDataForUserQuery): GetKPIDataForUserQuery {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string ProjectID = 1 [json_name = "ProjectID"];*/ 1:
                    message.projectID = reader.string();
                    break;
                case /* api.CHChartType ChartType = 2 [json_name = "ChartType"];*/ 2:
                    message.chartType = reader.int32();
                    break;
                case /* api.CHQueryType QueryType = 3 [json_name = "QueryType"];*/ 3:
                    message.queryType = reader.int32();
                    break;
                case /* string QueryBlock = 4 [json_name = "QueryBlock"];*/ 4:
                    message.queryBlock = reader.string();
                    break;
                case /* repeated api.CHDimension Dimensions = 5 [json_name = "Dimensions"];*/ 5:
                    message.dimensions.push(CHDimension.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated api.CHMetric Metrics = 6 [json_name = "Metrics"];*/ 6:
                    message.metrics.push(CHMetric.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* api.CHFilter Filter = 7 [json_name = "Filter"];*/ 7:
                    message.filter = CHFilter.internalBinaryRead(reader, reader.uint32(), options, message.filter);
                    break;
                case /* string TargetTimeZone = 8 [json_name = "TargetTimeZone"];*/ 8:
                    message.targetTimeZone = reader.string();
                    break;
                case /* api.KpiDataResultFormat ResultFormat = 9 [json_name = "ResultFormat"];*/ 9:
                    message.resultFormat = reader.int32();
                    break;
                case /* string KpiGroupName = 10 [json_name = "KpiGroupName"];*/ 10:
                    message.kpiGroupName = reader.string();
                    break;
                case /* string UserID = 11 [json_name = "UserID"];*/ 11:
                    message.userID = reader.string();
                    break;
                case /* string PagingState = 12 [json_name = "PagingState"];*/ 12:
                    message.pagingState = reader.string();
                    break;
                case /* string Limit = 13 [json_name = "Limit"];*/ 13:
                    message.limit = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: GetKPIDataForUserQuery, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string ProjectID = 1 [json_name = "ProjectID"]; */
        if (message.projectID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.projectID);
        /* api.CHChartType ChartType = 2 [json_name = "ChartType"]; */
        if (message.chartType !== 0)
            writer.tag(2, WireType.Varint).int32(message.chartType);
        /* api.CHQueryType QueryType = 3 [json_name = "QueryType"]; */
        if (message.queryType !== 0)
            writer.tag(3, WireType.Varint).int32(message.queryType);
        /* string QueryBlock = 4 [json_name = "QueryBlock"]; */
        if (message.queryBlock !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.queryBlock);
        /* repeated api.CHDimension Dimensions = 5 [json_name = "Dimensions"]; */
        for (let i = 0; i < message.dimensions.length; i++)
            CHDimension.internalBinaryWrite(message.dimensions[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.CHMetric Metrics = 6 [json_name = "Metrics"]; */
        for (let i = 0; i < message.metrics.length; i++)
            CHMetric.internalBinaryWrite(message.metrics[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* api.CHFilter Filter = 7 [json_name = "Filter"]; */
        if (message.filter)
            CHFilter.internalBinaryWrite(message.filter, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* string TargetTimeZone = 8 [json_name = "TargetTimeZone"]; */
        if (message.targetTimeZone !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.targetTimeZone);
        /* api.KpiDataResultFormat ResultFormat = 9 [json_name = "ResultFormat"]; */
        if (message.resultFormat !== 0)
            writer.tag(9, WireType.Varint).int32(message.resultFormat);
        /* string KpiGroupName = 10 [json_name = "KpiGroupName"]; */
        if (message.kpiGroupName !== "")
            writer.tag(10, WireType.LengthDelimited).string(message.kpiGroupName);
        /* string UserID = 11 [json_name = "UserID"]; */
        if (message.userID !== "")
            writer.tag(11, WireType.LengthDelimited).string(message.userID);
        /* string PagingState = 12 [json_name = "PagingState"]; */
        if (message.pagingState !== "")
            writer.tag(12, WireType.LengthDelimited).string(message.pagingState);
        /* string Limit = 13 [json_name = "Limit"]; */
        if (message.limit !== "")
            writer.tag(13, WireType.LengthDelimited).string(message.limit);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetKPIDataForUserQuery
 */
export const GetKPIDataForUserQuery = new GetKPIDataForUserQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetKPIDataResult$Type extends MessageType<GetKPIDataResult> {
    constructor() {
        super("api.GetKPIDataResult", [
            { no: 1, name: "Results", kind: "scalar", jsonName: "Results", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Raw result format" } } },
            { no: 2, name: "Series", kind: "message", jsonName: "Series", repeat: 1 /*RepeatType.PACKED*/, T: () => KpiDataSerie, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Json series formatted result format", example: "{\"Series\": [{\"Name\": \"Name\", \"Values\": [\"A\", \"B\", \"C\"]}, {\"Name\": \"Quantity\", \"Values\": [\"12\", \"99\", \"74\"]}, {\"Name\": \"Volume\", \"Values\": [\"34\", \"23\", \"65\"]}]}" } } }
        ]);
    }
    create(value?: PartialMessage<GetKPIDataResult>): GetKPIDataResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.results = "";
        message.series = [];
        if (value !== undefined)
            reflectionMergePartial<GetKPIDataResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetKPIDataResult): GetKPIDataResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Results = 1 [json_name = "Results"];*/ 1:
                    message.results = reader.string();
                    break;
                case /* repeated api.KpiDataSerie Series = 2 [json_name = "Series"];*/ 2:
                    message.series.push(KpiDataSerie.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: GetKPIDataResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Results = 1 [json_name = "Results"]; */
        if (message.results !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.results);
        /* repeated api.KpiDataSerie Series = 2 [json_name = "Series"]; */
        for (let i = 0; i < message.series.length; i++)
            KpiDataSerie.internalBinaryWrite(message.series[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetKPIDataResult
 */
export const GetKPIDataResult = new GetKPIDataResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EntityBlockFilter$Type extends MessageType<EntityBlockFilter> {
    constructor() {
        super("api.EntityBlockFilter", [
            { no: 1, name: "EntityName", kind: "scalar", jsonName: "EntityName", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "BlockFilters", kind: "message", jsonName: "BlockFilters", repeat: 1 /*RepeatType.PACKED*/, T: () => BlockFilter }
        ]);
    }
    create(value?: PartialMessage<EntityBlockFilter>): EntityBlockFilter {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.entityName = "";
        message.blockFilters = [];
        if (value !== undefined)
            reflectionMergePartial<EntityBlockFilter>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EntityBlockFilter): EntityBlockFilter {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string EntityName = 1 [json_name = "EntityName"];*/ 1:
                    message.entityName = reader.string();
                    break;
                case /* repeated api.BlockFilter BlockFilters = 2 [json_name = "BlockFilters"];*/ 2:
                    message.blockFilters.push(BlockFilter.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: EntityBlockFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string EntityName = 1 [json_name = "EntityName"]; */
        if (message.entityName !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.entityName);
        /* repeated api.BlockFilter BlockFilters = 2 [json_name = "BlockFilters"]; */
        for (let i = 0; i < message.blockFilters.length; i++)
            BlockFilter.internalBinaryWrite(message.blockFilters[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.EntityBlockFilter
 */
export const EntityBlockFilter = new EntityBlockFilter$Type();
// @generated message type with reflection information, may provide speed optimized methods
class FindKPIDataQuery$Type extends MessageType<FindKPIDataQuery> {
    constructor() {
        super("api.FindKPIDataQuery", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => QueryProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "QueryType", kind: "enum", jsonName: "QueryType", T: () => ["api.CHQueryType", CHQueryType], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 3, name: "QueryBlock", kind: "scalar", jsonName: "QueryBlock", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 4, name: "EntityBlockFilters", kind: "message", jsonName: "EntityBlockFilters", repeat: 1 /*RepeatType.PACKED*/, T: () => EntityBlockFilter },
            { no: 5, name: "Filter", kind: "message", jsonName: "Filter", T: () => CHFilter },
            { no: 6, name: "Dimensions", kind: "message", jsonName: "Dimensions", repeat: 1 /*RepeatType.PACKED*/, T: () => CHDimension },
            { no: 7, name: "Metrics", kind: "message", jsonName: "Metrics", repeat: 1 /*RepeatType.PACKED*/, T: () => CHMetric },
            { no: 8, name: "TargetTimeZone", kind: "scalar", jsonName: "TargetTimeZone", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1", tzData: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Target user time zone  <a href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>format</a>", example: "\"Europe/Paris\"" } } },
            { no: 9, name: "KpiGroupName", kind: "scalar", jsonName: "KpiGroupName", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { in: ["executionflow", "stock", "movement", "handlingunit", "actor", "item", "stock_extended", "claim"] } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Name of the analysis criterion to find the kpi data from", example: "\"stock_extended\"" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "ChartType", "QueryType", "QueryBlock", "Metrics", "KpiGroupName"] } } });
    }
    create(value?: PartialMessage<FindKPIDataQuery>): FindKPIDataQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.queryType = 0;
        message.queryBlock = "";
        message.entityBlockFilters = [];
        message.dimensions = [];
        message.metrics = [];
        message.targetTimeZone = "";
        message.kpiGroupName = "";
        if (value !== undefined)
            reflectionMergePartial<FindKPIDataQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FindKPIDataQuery): FindKPIDataQuery {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.QueryProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = QueryProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.CHQueryType QueryType = 2 [json_name = "QueryType"];*/ 2:
                    message.queryType = reader.int32();
                    break;
                case /* string QueryBlock = 3 [json_name = "QueryBlock"];*/ 3:
                    message.queryBlock = reader.string();
                    break;
                case /* repeated api.EntityBlockFilter EntityBlockFilters = 4 [json_name = "EntityBlockFilters"];*/ 4:
                    message.entityBlockFilters.push(EntityBlockFilter.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* api.CHFilter Filter = 5 [json_name = "Filter"];*/ 5:
                    message.filter = CHFilter.internalBinaryRead(reader, reader.uint32(), options, message.filter);
                    break;
                case /* repeated api.CHDimension Dimensions = 6 [json_name = "Dimensions"];*/ 6:
                    message.dimensions.push(CHDimension.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated api.CHMetric Metrics = 7 [json_name = "Metrics"];*/ 7:
                    message.metrics.push(CHMetric.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* string TargetTimeZone = 8 [json_name = "TargetTimeZone"];*/ 8:
                    message.targetTimeZone = reader.string();
                    break;
                case /* string KpiGroupName = 9 [json_name = "KpiGroupName"];*/ 9:
                    message.kpiGroupName = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: FindKPIDataQuery, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.QueryProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            QueryProjectHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.CHQueryType QueryType = 2 [json_name = "QueryType"]; */
        if (message.queryType !== 0)
            writer.tag(2, WireType.Varint).int32(message.queryType);
        /* string QueryBlock = 3 [json_name = "QueryBlock"]; */
        if (message.queryBlock !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.queryBlock);
        /* repeated api.EntityBlockFilter EntityBlockFilters = 4 [json_name = "EntityBlockFilters"]; */
        for (let i = 0; i < message.entityBlockFilters.length; i++)
            EntityBlockFilter.internalBinaryWrite(message.entityBlockFilters[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.CHFilter Filter = 5 [json_name = "Filter"]; */
        if (message.filter)
            CHFilter.internalBinaryWrite(message.filter, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.CHDimension Dimensions = 6 [json_name = "Dimensions"]; */
        for (let i = 0; i < message.dimensions.length; i++)
            CHDimension.internalBinaryWrite(message.dimensions[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.CHMetric Metrics = 7 [json_name = "Metrics"]; */
        for (let i = 0; i < message.metrics.length; i++)
            CHMetric.internalBinaryWrite(message.metrics[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* string TargetTimeZone = 8 [json_name = "TargetTimeZone"]; */
        if (message.targetTimeZone !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.targetTimeZone);
        /* string KpiGroupName = 9 [json_name = "KpiGroupName"]; */
        if (message.kpiGroupName !== "")
            writer.tag(9, WireType.LengthDelimited).string(message.kpiGroupName);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.FindKPIDataQuery
 */
export const FindKPIDataQuery = new FindKPIDataQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class FindKPIDataResult$Type extends MessageType<FindKPIDataResult> {
    constructor() {
        super("api.FindKPIDataResult", [
            { no: 1, name: "Series", kind: "message", jsonName: "Series", repeat: 1 /*RepeatType.PACKED*/, T: () => KpiDataSerie, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Json series formatted result format", example: "{\"Series\": [{\"Name\": \"Name\", \"Values\": [\"A\", \"B\", \"C\"]}, {\"Name\": \"Quantity\", \"Values\": [\"12\", \"99\", \"74\"]}, {\"Name\": \"Volume\", \"Values\": [\"34\", \"23\", \"65\"]}]}" } } }
        ]);
    }
    create(value?: PartialMessage<FindKPIDataResult>): FindKPIDataResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.series = [];
        if (value !== undefined)
            reflectionMergePartial<FindKPIDataResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FindKPIDataResult): FindKPIDataResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.KpiDataSerie Series = 1 [json_name = "Series"];*/ 1:
                    message.series.push(KpiDataSerie.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: FindKPIDataResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.KpiDataSerie Series = 1 [json_name = "Series"]; */
        for (let i = 0; i < message.series.length; i++)
            KpiDataSerie.internalBinaryWrite(message.series[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.FindKPIDataResult
 */
export const FindKPIDataResult = new FindKPIDataResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExtractKPIQuery$Type extends MessageType<ExtractKPIQuery> {
    constructor() {
        super("api.ExtractKPIQuery", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => QueryProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "UserId", kind: "scalar", jsonName: "UserId", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 3, name: "QueryType", kind: "enum", jsonName: "QueryType", T: () => ["api.CHQueryType", CHQueryType], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 4, name: "QueryBlock", kind: "scalar", jsonName: "QueryBlock", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 5, name: "EntityBlockFilters", kind: "message", jsonName: "EntityBlockFilters", repeat: 1 /*RepeatType.PACKED*/, T: () => EntityBlockFilter },
            { no: 6, name: "Filter", kind: "message", jsonName: "Filter", T: () => CHFilter },
            { no: 7, name: "Dimensions", kind: "message", jsonName: "Dimensions", repeat: 1 /*RepeatType.PACKED*/, T: () => CHDimension },
            { no: 8, name: "Metrics", kind: "message", jsonName: "Metrics", repeat: 1 /*RepeatType.PACKED*/, T: () => CHMetric },
            { no: 9, name: "TargetTimeZone", kind: "scalar", jsonName: "TargetTimeZone", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1", tzData: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Target user time zone  <a href='https://en.wikipedia.org/wiki/List_of_tz_database_time_zones'>format</a>", example: "\"Europe/Paris\"" } } },
            { no: 10, name: "KpiGroupName", kind: "scalar", jsonName: "KpiGroupName", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { in: ["executionflow", "stock", "movement", "handlingunit", "actor", "item", "stock_extended", "claim"] } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Name of the analysis criterion to find the kpi data from", example: "\"stock_extended\"" } } },
            { no: 11, name: "TargetDomain", kind: "scalar", jsonName: "TargetDomain", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 12, name: "TargetType", kind: "scalar", jsonName: "TargetType", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 13, name: "Fields", kind: "scalar", jsonName: "Fields", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 14, name: "ListSeparator", kind: "scalar", jsonName: "ListSeparator", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 15, name: "DecimalSeparator", kind: "scalar", jsonName: "DecimalSeparator", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 16, name: "ColumnNames", kind: "scalar", jsonName: "ColumnNames", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 17, name: "ColumnTranslationMaps", kind: "map", jsonName: "ColumnTranslationMaps", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => TranslationMap } },
            { no: 18, name: "FieldIdxLVDetailedQuantity", kind: "scalar", jsonName: "FieldIdxLVDetailedQuantity", repeat: 1 /*RepeatType.PACKED*/, T: 5 /*ScalarType.INT32*/ },
            { no: 19, name: "ColumnFormats", kind: "map", jsonName: "ColumnFormats", K: 5 /*ScalarType.INT32*/, V: { kind: "message", T: () => ExtractColumnFormat } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "UserId", "Fields", "ListSeparator", "DecimalSeparator", "ColumnName", "TargetDomain", "TargetType"] } } });
    }
    create(value?: PartialMessage<ExtractKPIQuery>): ExtractKPIQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.userId = "";
        message.queryType = 0;
        message.queryBlock = "";
        message.entityBlockFilters = [];
        message.dimensions = [];
        message.metrics = [];
        message.targetTimeZone = "";
        message.kpiGroupName = "";
        message.targetDomain = "";
        message.targetType = "";
        message.fields = [];
        message.listSeparator = "";
        message.decimalSeparator = "";
        message.columnNames = [];
        message.columnTranslationMaps = {};
        message.fieldIdxLVDetailedQuantity = [];
        message.columnFormats = {};
        if (value !== undefined)
            reflectionMergePartial<ExtractKPIQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExtractKPIQuery): ExtractKPIQuery {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.QueryProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = QueryProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* string UserId = 2 [json_name = "UserId"];*/ 2:
                    message.userId = reader.string();
                    break;
                case /* api.CHQueryType QueryType = 3 [json_name = "QueryType"];*/ 3:
                    message.queryType = reader.int32();
                    break;
                case /* string QueryBlock = 4 [json_name = "QueryBlock"];*/ 4:
                    message.queryBlock = reader.string();
                    break;
                case /* repeated api.EntityBlockFilter EntityBlockFilters = 5 [json_name = "EntityBlockFilters"];*/ 5:
                    message.entityBlockFilters.push(EntityBlockFilter.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* api.CHFilter Filter = 6 [json_name = "Filter"];*/ 6:
                    message.filter = CHFilter.internalBinaryRead(reader, reader.uint32(), options, message.filter);
                    break;
                case /* repeated api.CHDimension Dimensions = 7 [json_name = "Dimensions"];*/ 7:
                    message.dimensions.push(CHDimension.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated api.CHMetric Metrics = 8 [json_name = "Metrics"];*/ 8:
                    message.metrics.push(CHMetric.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* string TargetTimeZone = 9 [json_name = "TargetTimeZone"];*/ 9:
                    message.targetTimeZone = reader.string();
                    break;
                case /* string KpiGroupName = 10 [json_name = "KpiGroupName"];*/ 10:
                    message.kpiGroupName = reader.string();
                    break;
                case /* string TargetDomain = 11 [json_name = "TargetDomain"];*/ 11:
                    message.targetDomain = reader.string();
                    break;
                case /* string TargetType = 12 [json_name = "TargetType"];*/ 12:
                    message.targetType = reader.string();
                    break;
                case /* repeated string Fields = 13 [json_name = "Fields"];*/ 13:
                    message.fields.push(reader.string());
                    break;
                case /* string ListSeparator = 14 [json_name = "ListSeparator"];*/ 14:
                    message.listSeparator = reader.string();
                    break;
                case /* string DecimalSeparator = 15 [json_name = "DecimalSeparator"];*/ 15:
                    message.decimalSeparator = reader.string();
                    break;
                case /* repeated string ColumnNames = 16 [json_name = "ColumnNames"];*/ 16:
                    message.columnNames.push(reader.string());
                    break;
                case /* map<string, api.TranslationMap> ColumnTranslationMaps = 17 [json_name = "ColumnTranslationMaps"];*/ 17:
                    this.binaryReadMap17(message.columnTranslationMaps, reader, options);
                    break;
                case /* repeated int32 FieldIdxLVDetailedQuantity = 18 [json_name = "FieldIdxLVDetailedQuantity"];*/ 18:
                    if (wireType === WireType.LengthDelimited)
                        for (let e = reader.int32() + reader.pos; reader.pos < e;)
                            message.fieldIdxLVDetailedQuantity.push(reader.int32());
                    else
                        message.fieldIdxLVDetailedQuantity.push(reader.int32());
                    break;
                case /* map<int32, api.ExtractColumnFormat> ColumnFormats = 19 [json_name = "ColumnFormats"];*/ 19:
                    this.binaryReadMap19(message.columnFormats, reader, options);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    private binaryReadMap17(map: ExtractKPIQuery["columnTranslationMaps"], reader: IBinaryReader, options: BinaryReadOptions): void {
        let len = reader.uint32(), end = reader.pos + len, key: keyof ExtractKPIQuery["columnTranslationMaps"] | undefined, val: ExtractKPIQuery["columnTranslationMaps"][any] | undefined;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case 1:
                    key = reader.string();
                    break;
                case 2:
                    val = TranslationMap.internalBinaryRead(reader, reader.uint32(), options);
                    break;
                default: throw new globalThis.Error("unknown map entry field for field api.ExtractKPIQuery.ColumnTranslationMaps");
            }
        }
        map[key ?? ""] = val ?? TranslationMap.create();
    }
    private binaryReadMap19(map: ExtractKPIQuery["columnFormats"], reader: IBinaryReader, options: BinaryReadOptions): void {
        let len = reader.uint32(), end = reader.pos + len, key: keyof ExtractKPIQuery["columnFormats"] | undefined, val: ExtractKPIQuery["columnFormats"][any] | undefined;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case 1:
                    key = reader.int32();
                    break;
                case 2:
                    val = ExtractColumnFormat.internalBinaryRead(reader, reader.uint32(), options);
                    break;
                default: throw new globalThis.Error("unknown map entry field for field api.ExtractKPIQuery.ColumnFormats");
            }
        }
        map[key ?? 0] = val ?? ExtractColumnFormat.create();
    }
    internalBinaryWrite(message: ExtractKPIQuery, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.QueryProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            QueryProjectHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* string UserId = 2 [json_name = "UserId"]; */
        if (message.userId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.userId);
        /* api.CHQueryType QueryType = 3 [json_name = "QueryType"]; */
        if (message.queryType !== 0)
            writer.tag(3, WireType.Varint).int32(message.queryType);
        /* string QueryBlock = 4 [json_name = "QueryBlock"]; */
        if (message.queryBlock !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.queryBlock);
        /* repeated api.EntityBlockFilter EntityBlockFilters = 5 [json_name = "EntityBlockFilters"]; */
        for (let i = 0; i < message.entityBlockFilters.length; i++)
            EntityBlockFilter.internalBinaryWrite(message.entityBlockFilters[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* api.CHFilter Filter = 6 [json_name = "Filter"]; */
        if (message.filter)
            CHFilter.internalBinaryWrite(message.filter, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.CHDimension Dimensions = 7 [json_name = "Dimensions"]; */
        for (let i = 0; i < message.dimensions.length; i++)
            CHDimension.internalBinaryWrite(message.dimensions[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.CHMetric Metrics = 8 [json_name = "Metrics"]; */
        for (let i = 0; i < message.metrics.length; i++)
            CHMetric.internalBinaryWrite(message.metrics[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join();
        /* string TargetTimeZone = 9 [json_name = "TargetTimeZone"]; */
        if (message.targetTimeZone !== "")
            writer.tag(9, WireType.LengthDelimited).string(message.targetTimeZone);
        /* string KpiGroupName = 10 [json_name = "KpiGroupName"]; */
        if (message.kpiGroupName !== "")
            writer.tag(10, WireType.LengthDelimited).string(message.kpiGroupName);
        /* string TargetDomain = 11 [json_name = "TargetDomain"]; */
        if (message.targetDomain !== "")
            writer.tag(11, WireType.LengthDelimited).string(message.targetDomain);
        /* string TargetType = 12 [json_name = "TargetType"]; */
        if (message.targetType !== "")
            writer.tag(12, WireType.LengthDelimited).string(message.targetType);
        /* repeated string Fields = 13 [json_name = "Fields"]; */
        for (let i = 0; i < message.fields.length; i++)
            writer.tag(13, WireType.LengthDelimited).string(message.fields[i]);
        /* string ListSeparator = 14 [json_name = "ListSeparator"]; */
        if (message.listSeparator !== "")
            writer.tag(14, WireType.LengthDelimited).string(message.listSeparator);
        /* string DecimalSeparator = 15 [json_name = "DecimalSeparator"]; */
        if (message.decimalSeparator !== "")
            writer.tag(15, WireType.LengthDelimited).string(message.decimalSeparator);
        /* repeated string ColumnNames = 16 [json_name = "ColumnNames"]; */
        for (let i = 0; i < message.columnNames.length; i++)
            writer.tag(16, WireType.LengthDelimited).string(message.columnNames[i]);
        /* map<string, api.TranslationMap> ColumnTranslationMaps = 17 [json_name = "ColumnTranslationMaps"]; */
        for (let k of globalThis.Object.keys(message.columnTranslationMaps)) {
            writer.tag(17, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k);
            writer.tag(2, WireType.LengthDelimited).fork();
            TranslationMap.internalBinaryWrite(message.columnTranslationMaps[k], writer, options);
            writer.join().join();
        }
        /* repeated int32 FieldIdxLVDetailedQuantity = 18 [json_name = "FieldIdxLVDetailedQuantity"]; */
        if (message.fieldIdxLVDetailedQuantity.length) {
            writer.tag(18, WireType.LengthDelimited).fork();
            for (let i = 0; i < message.fieldIdxLVDetailedQuantity.length; i++)
                writer.int32(message.fieldIdxLVDetailedQuantity[i]);
            writer.join();
        }
        /* map<int32, api.ExtractColumnFormat> ColumnFormats = 19 [json_name = "ColumnFormats"]; */
        for (let k of globalThis.Object.keys(message.columnFormats)) {
            writer.tag(19, WireType.LengthDelimited).fork().tag(1, WireType.Varint).int32(parseInt(k));
            writer.tag(2, WireType.LengthDelimited).fork();
            ExtractColumnFormat.internalBinaryWrite(message.columnFormats[k as any], writer, options);
            writer.join().join();
        }
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ExtractKPIQuery
 */
export const ExtractKPIQuery = new ExtractKPIQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExtractKPIResult$Type extends MessageType<ExtractKPIResult> {
    constructor() {
        super("api.ExtractKPIResult", [
            { no: 1, name: "WorkflowExecution", kind: "message", jsonName: "WorkflowExecution", T: () => WorkflowExecutionResult }
        ]);
    }
    create(value?: PartialMessage<ExtractKPIResult>): ExtractKPIResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<ExtractKPIResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExtractKPIResult): ExtractKPIResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.WorkflowExecutionResult WorkflowExecution = 1 [json_name = "WorkflowExecution"];*/ 1:
                    message.workflowExecution = WorkflowExecutionResult.internalBinaryRead(reader, reader.uint32(), options, message.workflowExecution);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: ExtractKPIResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.WorkflowExecutionResult WorkflowExecution = 1 [json_name = "WorkflowExecution"]; */
        if (message.workflowExecution)
            WorkflowExecutionResult.internalBinaryWrite(message.workflowExecution, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ExtractKPIResult
 */
export const ExtractKPIResult = new ExtractKPIResult$Type();
