"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.FilePointer = exports.protobufPackage = void 0;
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const minimal_1 = __importDefault(require("protobufjs/minimal"));
const object_storage_1 = require("../../../../../../yandex/cloud/loadtesting/api/v1/test/object_storage");
exports.protobufPackage = 'yandex.cloud.loadtesting.api.v1.test';
const baseFilePointer = {};
exports.FilePointer = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.objectStorage !== undefined) {
            object_storage_1.ObjectStorage.encode(message.objectStorage, writer.uint32(10).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({}, baseFilePointer);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.objectStorage = object_storage_1.ObjectStorage.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseFilePointer);
        message.objectStorage =
            object.objectStorage !== undefined && object.objectStorage !== null
                ? object_storage_1.ObjectStorage.fromJSON(object.objectStorage)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.objectStorage !== undefined &&
            (obj.objectStorage = message.objectStorage
                ? object_storage_1.ObjectStorage.toJSON(message.objectStorage)
                : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = Object.assign({}, baseFilePointer);
        message.objectStorage =
            object.objectStorage !== undefined && object.objectStorage !== null
                ? object_storage_1.ObjectStorage.fromPartial(object.objectStorage)
                : undefined;
        return message;
    },
};
if (minimal_1.default.util.Long !== long_1.default) {
    minimal_1.default.util.Long = long_1.default;
    minimal_1.default.configure();
}
