"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Quantiles = exports.quantileTypeToJSON = exports.quantileTypeFromJSON = exports.QuantileType = exports.protobufPackage = void 0;
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const minimal_1 = __importDefault(require("protobufjs/minimal"));
exports.protobufPackage = 'yandex.cloud.loadtesting.api.v1.common';
/** Quantiles (percentiles). */
var QuantileType;
(function (QuantileType) {
    /** QUANTILE_TYPE_UNSPECIFIED - Unspecified percentile. */
    QuantileType[QuantileType["QUANTILE_TYPE_UNSPECIFIED"] = 0] = "QUANTILE_TYPE_UNSPECIFIED";
    /** QUANTILE_TYPE_50 - 50 percentile (median). */
    QuantileType[QuantileType["QUANTILE_TYPE_50"] = 1] = "QUANTILE_TYPE_50";
    /** QUANTILE_TYPE_75 - 75 percentile. */
    QuantileType[QuantileType["QUANTILE_TYPE_75"] = 2] = "QUANTILE_TYPE_75";
    /** QUANTILE_TYPE_80 - 80 percentile. */
    QuantileType[QuantileType["QUANTILE_TYPE_80"] = 3] = "QUANTILE_TYPE_80";
    /** QUANTILE_TYPE_85 - 85 percentile. */
    QuantileType[QuantileType["QUANTILE_TYPE_85"] = 4] = "QUANTILE_TYPE_85";
    /** QUANTILE_TYPE_90 - 90 percentile. */
    QuantileType[QuantileType["QUANTILE_TYPE_90"] = 5] = "QUANTILE_TYPE_90";
    /** QUANTILE_TYPE_95 - 95 percentile. */
    QuantileType[QuantileType["QUANTILE_TYPE_95"] = 6] = "QUANTILE_TYPE_95";
    /** QUANTILE_TYPE_98 - 98 percentile. */
    QuantileType[QuantileType["QUANTILE_TYPE_98"] = 7] = "QUANTILE_TYPE_98";
    /** QUANTILE_TYPE_99 - 99 percentile. */
    QuantileType[QuantileType["QUANTILE_TYPE_99"] = 8] = "QUANTILE_TYPE_99";
    /** QUANTILE_TYPE_100 - 100 percentile (maximum or minimum). */
    QuantileType[QuantileType["QUANTILE_TYPE_100"] = 9] = "QUANTILE_TYPE_100";
    QuantileType[QuantileType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(QuantileType = exports.QuantileType || (exports.QuantileType = {}));
function quantileTypeFromJSON(object) {
    switch (object) {
        case 0:
        case 'QUANTILE_TYPE_UNSPECIFIED':
            return QuantileType.QUANTILE_TYPE_UNSPECIFIED;
        case 1:
        case 'QUANTILE_TYPE_50':
            return QuantileType.QUANTILE_TYPE_50;
        case 2:
        case 'QUANTILE_TYPE_75':
            return QuantileType.QUANTILE_TYPE_75;
        case 3:
        case 'QUANTILE_TYPE_80':
            return QuantileType.QUANTILE_TYPE_80;
        case 4:
        case 'QUANTILE_TYPE_85':
            return QuantileType.QUANTILE_TYPE_85;
        case 5:
        case 'QUANTILE_TYPE_90':
            return QuantileType.QUANTILE_TYPE_90;
        case 6:
        case 'QUANTILE_TYPE_95':
            return QuantileType.QUANTILE_TYPE_95;
        case 7:
        case 'QUANTILE_TYPE_98':
            return QuantileType.QUANTILE_TYPE_98;
        case 8:
        case 'QUANTILE_TYPE_99':
            return QuantileType.QUANTILE_TYPE_99;
        case 9:
        case 'QUANTILE_TYPE_100':
            return QuantileType.QUANTILE_TYPE_100;
        case -1:
        case 'UNRECOGNIZED':
        default:
            return QuantileType.UNRECOGNIZED;
    }
}
exports.quantileTypeFromJSON = quantileTypeFromJSON;
function quantileTypeToJSON(object) {
    switch (object) {
        case QuantileType.QUANTILE_TYPE_UNSPECIFIED:
            return 'QUANTILE_TYPE_UNSPECIFIED';
        case QuantileType.QUANTILE_TYPE_50:
            return 'QUANTILE_TYPE_50';
        case QuantileType.QUANTILE_TYPE_75:
            return 'QUANTILE_TYPE_75';
        case QuantileType.QUANTILE_TYPE_80:
            return 'QUANTILE_TYPE_80';
        case QuantileType.QUANTILE_TYPE_85:
            return 'QUANTILE_TYPE_85';
        case QuantileType.QUANTILE_TYPE_90:
            return 'QUANTILE_TYPE_90';
        case QuantileType.QUANTILE_TYPE_95:
            return 'QUANTILE_TYPE_95';
        case QuantileType.QUANTILE_TYPE_98:
            return 'QUANTILE_TYPE_98';
        case QuantileType.QUANTILE_TYPE_99:
            return 'QUANTILE_TYPE_99';
        case QuantileType.QUANTILE_TYPE_100:
            return 'QUANTILE_TYPE_100';
        default:
            return 'UNKNOWN';
    }
}
exports.quantileTypeToJSON = quantileTypeToJSON;
const baseQuantiles = {
    q50: 0,
    q75: 0,
    q80: 0,
    q85: 0,
    q90: 0,
    q95: 0,
    q98: 0,
    q99: 0,
    q100: 0,
};
exports.Quantiles = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.q50 !== 0) {
            writer.uint32(9).double(message.q50);
        }
        if (message.q75 !== 0) {
            writer.uint32(17).double(message.q75);
        }
        if (message.q80 !== 0) {
            writer.uint32(25).double(message.q80);
        }
        if (message.q85 !== 0) {
            writer.uint32(33).double(message.q85);
        }
        if (message.q90 !== 0) {
            writer.uint32(41).double(message.q90);
        }
        if (message.q95 !== 0) {
            writer.uint32(49).double(message.q95);
        }
        if (message.q98 !== 0) {
            writer.uint32(57).double(message.q98);
        }
        if (message.q99 !== 0) {
            writer.uint32(65).double(message.q99);
        }
        if (message.q100 !== 0) {
            writer.uint32(73).double(message.q100);
        }
        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({}, baseQuantiles);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.q50 = reader.double();
                    break;
                case 2:
                    message.q75 = reader.double();
                    break;
                case 3:
                    message.q80 = reader.double();
                    break;
                case 4:
                    message.q85 = reader.double();
                    break;
                case 5:
                    message.q90 = reader.double();
                    break;
                case 6:
                    message.q95 = reader.double();
                    break;
                case 7:
                    message.q98 = reader.double();
                    break;
                case 8:
                    message.q99 = reader.double();
                    break;
                case 9:
                    message.q100 = reader.double();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseQuantiles);
        message.q50 = object.q50 !== undefined && object.q50 !== null ? Number(object.q50) : 0;
        message.q75 = object.q75 !== undefined && object.q75 !== null ? Number(object.q75) : 0;
        message.q80 = object.q80 !== undefined && object.q80 !== null ? Number(object.q80) : 0;
        message.q85 = object.q85 !== undefined && object.q85 !== null ? Number(object.q85) : 0;
        message.q90 = object.q90 !== undefined && object.q90 !== null ? Number(object.q90) : 0;
        message.q95 = object.q95 !== undefined && object.q95 !== null ? Number(object.q95) : 0;
        message.q98 = object.q98 !== undefined && object.q98 !== null ? Number(object.q98) : 0;
        message.q99 = object.q99 !== undefined && object.q99 !== null ? Number(object.q99) : 0;
        message.q100 = object.q100 !== undefined && object.q100 !== null ? Number(object.q100) : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.q50 !== undefined && (obj.q50 = message.q50);
        message.q75 !== undefined && (obj.q75 = message.q75);
        message.q80 !== undefined && (obj.q80 = message.q80);
        message.q85 !== undefined && (obj.q85 = message.q85);
        message.q90 !== undefined && (obj.q90 = message.q90);
        message.q95 !== undefined && (obj.q95 = message.q95);
        message.q98 !== undefined && (obj.q98 = message.q98);
        message.q99 !== undefined && (obj.q99 = message.q99);
        message.q100 !== undefined && (obj.q100 = message.q100);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j;
        const message = Object.assign({}, baseQuantiles);
        message.q50 = (_a = object.q50) !== null && _a !== void 0 ? _a : 0;
        message.q75 = (_b = object.q75) !== null && _b !== void 0 ? _b : 0;
        message.q80 = (_c = object.q80) !== null && _c !== void 0 ? _c : 0;
        message.q85 = (_d = object.q85) !== null && _d !== void 0 ? _d : 0;
        message.q90 = (_e = object.q90) !== null && _e !== void 0 ? _e : 0;
        message.q95 = (_f = object.q95) !== null && _f !== void 0 ? _f : 0;
        message.q98 = (_g = object.q98) !== null && _g !== void 0 ? _g : 0;
        message.q99 = (_h = object.q99) !== null && _h !== void 0 ? _h : 0;
        message.q100 = (_j = object.q100) !== null && _j !== void 0 ? _j : 0;
        return message;
    },
};
if (minimal_1.default.util.Long !== long_1.default) {
    minimal_1.default.util.Long = long_1.default;
    minimal_1.default.configure();
}
