"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.KpiSelector_NetworkCodesRelative = exports.KpiSelector_NetworkCodesAbsolute = exports.KpiSelector_ProtocolCodesRelative = exports.KpiSelector_ProtocolCodesAbsolute = exports.KpiSelector_ImbalanceRps = exports.KpiSelector_Instances = exports.KpiSelector_ResponseTime = exports.KpiSelector = exports.KpiThreshold = exports.Kpi = exports.comparisonToJSON = exports.comparisonFromJSON = exports.Comparison = exports.aggregationToJSON = exports.aggregationFromJSON = exports.Aggregation = exports.protobufPackage = void 0;
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const minimal_1 = __importDefault(require("protobufjs/minimal"));
const quantiles_1 = require("../../../../../../yandex/cloud/loadtesting/api/v1/common/quantiles");
exports.protobufPackage = 'yandex.cloud.loadtesting.api.v1.report';
/** Aggregation function. */
var Aggregation;
(function (Aggregation) {
    /** AGGREGATION_UNSPECIFIED - Unspecified. */
    Aggregation[Aggregation["AGGREGATION_UNSPECIFIED"] = 0] = "AGGREGATION_UNSPECIFIED";
    /** AGGREGATION_MIN - Minimum. */
    Aggregation[Aggregation["AGGREGATION_MIN"] = 1] = "AGGREGATION_MIN";
    /** AGGREGATION_MAX - Maximum. */
    Aggregation[Aggregation["AGGREGATION_MAX"] = 2] = "AGGREGATION_MAX";
    /** AGGREGATION_AVG - Average. */
    Aggregation[Aggregation["AGGREGATION_AVG"] = 4] = "AGGREGATION_AVG";
    /** AGGREGATION_MEDIAN - Median. */
    Aggregation[Aggregation["AGGREGATION_MEDIAN"] = 5] = "AGGREGATION_MEDIAN";
    /** AGGREGATION_STD_DEV - Standard deviation. */
    Aggregation[Aggregation["AGGREGATION_STD_DEV"] = 6] = "AGGREGATION_STD_DEV";
    Aggregation[Aggregation["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(Aggregation = exports.Aggregation || (exports.Aggregation = {}));
function aggregationFromJSON(object) {
    switch (object) {
        case 0:
        case 'AGGREGATION_UNSPECIFIED':
            return Aggregation.AGGREGATION_UNSPECIFIED;
        case 1:
        case 'AGGREGATION_MIN':
            return Aggregation.AGGREGATION_MIN;
        case 2:
        case 'AGGREGATION_MAX':
            return Aggregation.AGGREGATION_MAX;
        case 4:
        case 'AGGREGATION_AVG':
            return Aggregation.AGGREGATION_AVG;
        case 5:
        case 'AGGREGATION_MEDIAN':
            return Aggregation.AGGREGATION_MEDIAN;
        case 6:
        case 'AGGREGATION_STD_DEV':
            return Aggregation.AGGREGATION_STD_DEV;
        case -1:
        case 'UNRECOGNIZED':
        default:
            return Aggregation.UNRECOGNIZED;
    }
}
exports.aggregationFromJSON = aggregationFromJSON;
function aggregationToJSON(object) {
    switch (object) {
        case Aggregation.AGGREGATION_UNSPECIFIED:
            return 'AGGREGATION_UNSPECIFIED';
        case Aggregation.AGGREGATION_MIN:
            return 'AGGREGATION_MIN';
        case Aggregation.AGGREGATION_MAX:
            return 'AGGREGATION_MAX';
        case Aggregation.AGGREGATION_AVG:
            return 'AGGREGATION_AVG';
        case Aggregation.AGGREGATION_MEDIAN:
            return 'AGGREGATION_MEDIAN';
        case Aggregation.AGGREGATION_STD_DEV:
            return 'AGGREGATION_STD_DEV';
        default:
            return 'UNKNOWN';
    }
}
exports.aggregationToJSON = aggregationToJSON;
/** Comparison operator. */
var Comparison;
(function (Comparison) {
    /** COMPARISON_UNSPECIFIED - Unspecified. */
    Comparison[Comparison["COMPARISON_UNSPECIFIED"] = 0] = "COMPARISON_UNSPECIFIED";
    /** COMPARISON_LT - Less than the specified value. */
    Comparison[Comparison["COMPARISON_LT"] = 1] = "COMPARISON_LT";
    /** COMPARISON_LTE - Less than or equal to the specified value. */
    Comparison[Comparison["COMPARISON_LTE"] = 2] = "COMPARISON_LTE";
    /** COMPARISON_GT - Greater than the specified value. */
    Comparison[Comparison["COMPARISON_GT"] = 3] = "COMPARISON_GT";
    /** COMPARISON_GTE - Greater than or equal to the specified value. */
    Comparison[Comparison["COMPARISON_GTE"] = 4] = "COMPARISON_GTE";
    Comparison[Comparison["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(Comparison = exports.Comparison || (exports.Comparison = {}));
function comparisonFromJSON(object) {
    switch (object) {
        case 0:
        case 'COMPARISON_UNSPECIFIED':
            return Comparison.COMPARISON_UNSPECIFIED;
        case 1:
        case 'COMPARISON_LT':
            return Comparison.COMPARISON_LT;
        case 2:
        case 'COMPARISON_LTE':
            return Comparison.COMPARISON_LTE;
        case 3:
        case 'COMPARISON_GT':
            return Comparison.COMPARISON_GT;
        case 4:
        case 'COMPARISON_GTE':
            return Comparison.COMPARISON_GTE;
        case -1:
        case 'UNRECOGNIZED':
        default:
            return Comparison.UNRECOGNIZED;
    }
}
exports.comparisonFromJSON = comparisonFromJSON;
function comparisonToJSON(object) {
    switch (object) {
        case Comparison.COMPARISON_UNSPECIFIED:
            return 'COMPARISON_UNSPECIFIED';
        case Comparison.COMPARISON_LT:
            return 'COMPARISON_LT';
        case Comparison.COMPARISON_LTE:
            return 'COMPARISON_LTE';
        case Comparison.COMPARISON_GT:
            return 'COMPARISON_GT';
        case Comparison.COMPARISON_GTE:
            return 'COMPARISON_GTE';
        default:
            return 'UNKNOWN';
    }
}
exports.comparisonToJSON = comparisonToJSON;
const baseKpi = {};
exports.Kpi = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.selector !== undefined) {
            exports.KpiSelector.encode(message.selector, writer.uint32(10).fork()).ldelim();
        }
        if (message.threshold !== undefined) {
            exports.KpiThreshold.encode(message.threshold, writer.uint32(18).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpi);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.selector = exports.KpiSelector.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.threshold = exports.KpiThreshold.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseKpi);
        message.selector =
            object.selector !== undefined && object.selector !== null
                ? exports.KpiSelector.fromJSON(object.selector)
                : undefined;
        message.threshold =
            object.threshold !== undefined && object.threshold !== null
                ? exports.KpiThreshold.fromJSON(object.threshold)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.selector !== undefined &&
            (obj.selector = message.selector ? exports.KpiSelector.toJSON(message.selector) : undefined);
        message.threshold !== undefined &&
            (obj.threshold = message.threshold
                ? exports.KpiThreshold.toJSON(message.threshold)
                : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = Object.assign({}, baseKpi);
        message.selector =
            object.selector !== undefined && object.selector !== null
                ? exports.KpiSelector.fromPartial(object.selector)
                : undefined;
        message.threshold =
            object.threshold !== undefined && object.threshold !== null
                ? exports.KpiThreshold.fromPartial(object.threshold)
                : undefined;
        return message;
    },
};
const baseKpiThreshold = { value: 0, comparison: 0 };
exports.KpiThreshold = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.value !== 0) {
            writer.uint32(9).double(message.value);
        }
        if (message.comparison !== 0) {
            writer.uint32(16).int32(message.comparison);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpiThreshold);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.value = reader.double();
                    break;
                case 2:
                    message.comparison = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseKpiThreshold);
        message.value =
            object.value !== undefined && object.value !== null ? Number(object.value) : 0;
        message.comparison =
            object.comparison !== undefined && object.comparison !== null
                ? comparisonFromJSON(object.comparison)
                : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.value !== undefined && (obj.value = message.value);
        message.comparison !== undefined && (obj.comparison = comparisonToJSON(message.comparison));
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseKpiThreshold);
        message.value = (_a = object.value) !== null && _a !== void 0 ? _a : 0;
        message.comparison = (_b = object.comparison) !== null && _b !== void 0 ? _b : 0;
        return message;
    },
};
const baseKpiSelector = {};
exports.KpiSelector = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.responseTime !== undefined) {
            exports.KpiSelector_ResponseTime.encode(message.responseTime, writer.uint32(10).fork()).ldelim();
        }
        if (message.instances !== undefined) {
            exports.KpiSelector_Instances.encode(message.instances, writer.uint32(18).fork()).ldelim();
        }
        if (message.imbalanceRps !== undefined) {
            exports.KpiSelector_ImbalanceRps.encode(message.imbalanceRps, writer.uint32(26).fork()).ldelim();
        }
        if (message.protocolCodesAbsolute !== undefined) {
            exports.KpiSelector_ProtocolCodesAbsolute.encode(message.protocolCodesAbsolute, writer.uint32(34).fork()).ldelim();
        }
        if (message.protocolCodesRelative !== undefined) {
            exports.KpiSelector_ProtocolCodesRelative.encode(message.protocolCodesRelative, writer.uint32(42).fork()).ldelim();
        }
        if (message.networkCodesAbsolute !== undefined) {
            exports.KpiSelector_NetworkCodesAbsolute.encode(message.networkCodesAbsolute, writer.uint32(50).fork()).ldelim();
        }
        if (message.networkCodesRelative !== undefined) {
            exports.KpiSelector_NetworkCodesRelative.encode(message.networkCodesRelative, writer.uint32(58).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpiSelector);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.responseTime = exports.KpiSelector_ResponseTime.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.instances = exports.KpiSelector_Instances.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.imbalanceRps = exports.KpiSelector_ImbalanceRps.decode(reader, reader.uint32());
                    break;
                case 4:
                    message.protocolCodesAbsolute = exports.KpiSelector_ProtocolCodesAbsolute.decode(reader, reader.uint32());
                    break;
                case 5:
                    message.protocolCodesRelative = exports.KpiSelector_ProtocolCodesRelative.decode(reader, reader.uint32());
                    break;
                case 6:
                    message.networkCodesAbsolute = exports.KpiSelector_NetworkCodesAbsolute.decode(reader, reader.uint32());
                    break;
                case 7:
                    message.networkCodesRelative = exports.KpiSelector_NetworkCodesRelative.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseKpiSelector);
        message.responseTime =
            object.responseTime !== undefined && object.responseTime !== null
                ? exports.KpiSelector_ResponseTime.fromJSON(object.responseTime)
                : undefined;
        message.instances =
            object.instances !== undefined && object.instances !== null
                ? exports.KpiSelector_Instances.fromJSON(object.instances)
                : undefined;
        message.imbalanceRps =
            object.imbalanceRps !== undefined && object.imbalanceRps !== null
                ? exports.KpiSelector_ImbalanceRps.fromJSON(object.imbalanceRps)
                : undefined;
        message.protocolCodesAbsolute =
            object.protocolCodesAbsolute !== undefined && object.protocolCodesAbsolute !== null
                ? exports.KpiSelector_ProtocolCodesAbsolute.fromJSON(object.protocolCodesAbsolute)
                : undefined;
        message.protocolCodesRelative =
            object.protocolCodesRelative !== undefined && object.protocolCodesRelative !== null
                ? exports.KpiSelector_ProtocolCodesRelative.fromJSON(object.protocolCodesRelative)
                : undefined;
        message.networkCodesAbsolute =
            object.networkCodesAbsolute !== undefined && object.networkCodesAbsolute !== null
                ? exports.KpiSelector_NetworkCodesAbsolute.fromJSON(object.networkCodesAbsolute)
                : undefined;
        message.networkCodesRelative =
            object.networkCodesRelative !== undefined && object.networkCodesRelative !== null
                ? exports.KpiSelector_NetworkCodesRelative.fromJSON(object.networkCodesRelative)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.responseTime !== undefined &&
            (obj.responseTime = message.responseTime
                ? exports.KpiSelector_ResponseTime.toJSON(message.responseTime)
                : undefined);
        message.instances !== undefined &&
            (obj.instances = message.instances
                ? exports.KpiSelector_Instances.toJSON(message.instances)
                : undefined);
        message.imbalanceRps !== undefined &&
            (obj.imbalanceRps = message.imbalanceRps
                ? exports.KpiSelector_ImbalanceRps.toJSON(message.imbalanceRps)
                : undefined);
        message.protocolCodesAbsolute !== undefined &&
            (obj.protocolCodesAbsolute = message.protocolCodesAbsolute
                ? exports.KpiSelector_ProtocolCodesAbsolute.toJSON(message.protocolCodesAbsolute)
                : undefined);
        message.protocolCodesRelative !== undefined &&
            (obj.protocolCodesRelative = message.protocolCodesRelative
                ? exports.KpiSelector_ProtocolCodesRelative.toJSON(message.protocolCodesRelative)
                : undefined);
        message.networkCodesAbsolute !== undefined &&
            (obj.networkCodesAbsolute = message.networkCodesAbsolute
                ? exports.KpiSelector_NetworkCodesAbsolute.toJSON(message.networkCodesAbsolute)
                : undefined);
        message.networkCodesRelative !== undefined &&
            (obj.networkCodesRelative = message.networkCodesRelative
                ? exports.KpiSelector_NetworkCodesRelative.toJSON(message.networkCodesRelative)
                : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = Object.assign({}, baseKpiSelector);
        message.responseTime =
            object.responseTime !== undefined && object.responseTime !== null
                ? exports.KpiSelector_ResponseTime.fromPartial(object.responseTime)
                : undefined;
        message.instances =
            object.instances !== undefined && object.instances !== null
                ? exports.KpiSelector_Instances.fromPartial(object.instances)
                : undefined;
        message.imbalanceRps =
            object.imbalanceRps !== undefined && object.imbalanceRps !== null
                ? exports.KpiSelector_ImbalanceRps.fromPartial(object.imbalanceRps)
                : undefined;
        message.protocolCodesAbsolute =
            object.protocolCodesAbsolute !== undefined && object.protocolCodesAbsolute !== null
                ? exports.KpiSelector_ProtocolCodesAbsolute.fromPartial(object.protocolCodesAbsolute)
                : undefined;
        message.protocolCodesRelative =
            object.protocolCodesRelative !== undefined && object.protocolCodesRelative !== null
                ? exports.KpiSelector_ProtocolCodesRelative.fromPartial(object.protocolCodesRelative)
                : undefined;
        message.networkCodesAbsolute =
            object.networkCodesAbsolute !== undefined && object.networkCodesAbsolute !== null
                ? exports.KpiSelector_NetworkCodesAbsolute.fromPartial(object.networkCodesAbsolute)
                : undefined;
        message.networkCodesRelative =
            object.networkCodesRelative !== undefined && object.networkCodesRelative !== null
                ? exports.KpiSelector_NetworkCodesRelative.fromPartial(object.networkCodesRelative)
                : undefined;
        return message;
    },
};
const baseKpiSelector_ResponseTime = { quantile: 0 };
exports.KpiSelector_ResponseTime = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.quantile !== 0) {
            writer.uint32(8).int32(message.quantile);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpiSelector_ResponseTime);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.quantile = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseKpiSelector_ResponseTime);
        message.quantile =
            object.quantile !== undefined && object.quantile !== null
                ? (0, quantiles_1.quantileTypeFromJSON)(object.quantile)
                : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.quantile !== undefined && (obj.quantile = (0, quantiles_1.quantileTypeToJSON)(message.quantile));
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_ResponseTime);
        message.quantile = (_a = object.quantile) !== null && _a !== void 0 ? _a : 0;
        return message;
    },
};
const baseKpiSelector_Instances = { agg: 0 };
exports.KpiSelector_Instances = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.agg !== 0) {
            writer.uint32(8).int32(message.agg);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpiSelector_Instances);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.agg = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseKpiSelector_Instances);
        message.agg =
            object.agg !== undefined && object.agg !== null ? aggregationFromJSON(object.agg) : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.agg !== undefined && (obj.agg = aggregationToJSON(message.agg));
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_Instances);
        message.agg = (_a = object.agg) !== null && _a !== void 0 ? _a : 0;
        return message;
    },
};
const baseKpiSelector_ImbalanceRps = {};
exports.KpiSelector_ImbalanceRps = {
    encode(_, writer = minimal_1.default.Writer.create()) {
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpiSelector_ImbalanceRps);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        const message = Object.assign({}, baseKpiSelector_ImbalanceRps);
        return message;
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = Object.assign({}, baseKpiSelector_ImbalanceRps);
        return message;
    },
};
const baseKpiSelector_ProtocolCodesAbsolute = { codesPatterns: '' };
exports.KpiSelector_ProtocolCodesAbsolute = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.codesPatterns) {
            writer.uint32(10).string(v);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpiSelector_ProtocolCodesAbsolute);
        message.codesPatterns = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.codesPatterns.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_ProtocolCodesAbsolute);
        message.codesPatterns = ((_a = object.codesPatterns) !== null && _a !== void 0 ? _a : []).map((e) => String(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.codesPatterns) {
            obj.codesPatterns = message.codesPatterns.map((e) => e);
        }
        else {
            obj.codesPatterns = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_ProtocolCodesAbsolute);
        message.codesPatterns = ((_a = object.codesPatterns) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
        return message;
    },
};
const baseKpiSelector_ProtocolCodesRelative = { codesPatterns: '' };
exports.KpiSelector_ProtocolCodesRelative = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.codesPatterns) {
            writer.uint32(10).string(v);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpiSelector_ProtocolCodesRelative);
        message.codesPatterns = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.codesPatterns.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_ProtocolCodesRelative);
        message.codesPatterns = ((_a = object.codesPatterns) !== null && _a !== void 0 ? _a : []).map((e) => String(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.codesPatterns) {
            obj.codesPatterns = message.codesPatterns.map((e) => e);
        }
        else {
            obj.codesPatterns = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_ProtocolCodesRelative);
        message.codesPatterns = ((_a = object.codesPatterns) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
        return message;
    },
};
const baseKpiSelector_NetworkCodesAbsolute = { codesPatterns: '' };
exports.KpiSelector_NetworkCodesAbsolute = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.codesPatterns) {
            writer.uint32(10).string(v);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpiSelector_NetworkCodesAbsolute);
        message.codesPatterns = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.codesPatterns.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_NetworkCodesAbsolute);
        message.codesPatterns = ((_a = object.codesPatterns) !== null && _a !== void 0 ? _a : []).map((e) => String(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.codesPatterns) {
            obj.codesPatterns = message.codesPatterns.map((e) => e);
        }
        else {
            obj.codesPatterns = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_NetworkCodesAbsolute);
        message.codesPatterns = ((_a = object.codesPatterns) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
        return message;
    },
};
const baseKpiSelector_NetworkCodesRelative = { codesPatterns: '' };
exports.KpiSelector_NetworkCodesRelative = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.codesPatterns) {
            writer.uint32(10).string(v);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = Object.assign({}, baseKpiSelector_NetworkCodesRelative);
        message.codesPatterns = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.codesPatterns.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_NetworkCodesRelative);
        message.codesPatterns = ((_a = object.codesPatterns) !== null && _a !== void 0 ? _a : []).map((e) => String(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.codesPatterns) {
            obj.codesPatterns = message.codesPatterns.map((e) => e);
        }
        else {
            obj.codesPatterns = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseKpiSelector_NetworkCodesRelative);
        message.codesPatterns = ((_a = object.codesPatterns) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
        return message;
    },
};
if (minimal_1.default.util.Long !== long_1.default) {
    minimal_1.default.util.Long = long_1.default;
    minimal_1.default.configure();
}
