"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArtifactSettings = 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 baseArtifactSettings = { isArchive: false, filterInclude: '', filterExclude: '' };
exports.ArtifactSettings = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.objectStorageBucket !== undefined) {
            writer.uint32(10).string(message.objectStorageBucket);
        }
        if (message.isArchive === true) {
            writer.uint32(48).bool(message.isArchive);
        }
        for (const v of message.filterInclude) {
            writer.uint32(58).string(v);
        }
        for (const v of message.filterExclude) {
            writer.uint32(66).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({}, baseArtifactSettings);
        message.filterInclude = [];
        message.filterExclude = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.objectStorageBucket = reader.string();
                    break;
                case 6:
                    message.isArchive = reader.bool();
                    break;
                case 7:
                    message.filterInclude.push(reader.string());
                    break;
                case 8:
                    message.filterExclude.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a, _b;
        const message = Object.assign({}, baseArtifactSettings);
        message.objectStorageBucket =
            object.objectStorageBucket !== undefined && object.objectStorageBucket !== null
                ? String(object.objectStorageBucket)
                : undefined;
        message.isArchive =
            object.isArchive !== undefined && object.isArchive !== null
                ? Boolean(object.isArchive)
                : false;
        message.filterInclude = ((_a = object.filterInclude) !== null && _a !== void 0 ? _a : []).map((e) => String(e));
        message.filterExclude = ((_b = object.filterExclude) !== null && _b !== void 0 ? _b : []).map((e) => String(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.objectStorageBucket !== undefined &&
            (obj.objectStorageBucket = message.objectStorageBucket);
        message.isArchive !== undefined && (obj.isArchive = message.isArchive);
        if (message.filterInclude) {
            obj.filterInclude = message.filterInclude.map((e) => e);
        }
        else {
            obj.filterInclude = [];
        }
        if (message.filterExclude) {
            obj.filterExclude = message.filterExclude.map((e) => e);
        }
        else {
            obj.filterExclude = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d;
        const message = Object.assign({}, baseArtifactSettings);
        message.objectStorageBucket = (_a = object.objectStorageBucket) !== null && _a !== void 0 ? _a : undefined;
        message.isArchive = (_b = object.isArchive) !== null && _b !== void 0 ? _b : false;
        message.filterInclude = ((_c = object.filterInclude) === null || _c === void 0 ? void 0 : _c.map((e) => e)) || [];
        message.filterExclude = ((_d = object.filterExclude) === null || _d === void 0 ? void 0 : _d.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();
}
