"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AgentSelector = 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.test';
const baseAgentSelector = {};
exports.AgentSelector = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.agentId !== undefined) {
            writer.uint32(10).string(message.agentId);
        }
        if (message.matchByFilter !== undefined) {
            writer.uint32(18).string(message.matchByFilter);
        }
        if (message.anonymousAgent !== undefined) {
            writer.uint32(24).bool(message.anonymousAgent);
        }
        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({}, baseAgentSelector);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.agentId = reader.string();
                    break;
                case 2:
                    message.matchByFilter = reader.string();
                    break;
                case 3:
                    message.anonymousAgent = reader.bool();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseAgentSelector);
        message.agentId =
            object.agentId !== undefined && object.agentId !== null
                ? String(object.agentId)
                : undefined;
        message.matchByFilter =
            object.matchByFilter !== undefined && object.matchByFilter !== null
                ? String(object.matchByFilter)
                : undefined;
        message.anonymousAgent =
            object.anonymousAgent !== undefined && object.anonymousAgent !== null
                ? Boolean(object.anonymousAgent)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.agentId !== undefined && (obj.agentId = message.agentId);
        message.matchByFilter !== undefined && (obj.matchByFilter = message.matchByFilter);
        message.anonymousAgent !== undefined && (obj.anonymousAgent = message.anonymousAgent);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c;
        const message = Object.assign({}, baseAgentSelector);
        message.agentId = (_a = object.agentId) !== null && _a !== void 0 ? _a : undefined;
        message.matchByFilter = (_b = object.matchByFilter) !== null && _b !== void 0 ? _b : undefined;
        message.anonymousAgent = (_c = object.anonymousAgent) !== null && _c !== void 0 ? _c : undefined;
        return message;
    },
};
if (minimal_1.default.util.Long !== long_1.default) {
    minimal_1.default.util.Long = long_1.default;
    minimal_1.default.configure();
}
