"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Manifest = exports.manifest_ManifestTypeToJSON = exports.manifest_ManifestTypeFromJSON = exports.Manifest_ManifestType = exports.protobufPackage = void 0;
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const minimal_1 = __importDefault(require("protobufjs/minimal"));
exports.protobufPackage = 'yandex.cloud.video.v1';
var Manifest_ManifestType;
(function (Manifest_ManifestType) {
    Manifest_ManifestType[Manifest_ManifestType["MANIFEST_TYPE_UNSPECIFIED"] = 0] = "MANIFEST_TYPE_UNSPECIFIED";
    Manifest_ManifestType[Manifest_ManifestType["DASH"] = 1] = "DASH";
    Manifest_ManifestType[Manifest_ManifestType["HLS"] = 2] = "HLS";
    Manifest_ManifestType[Manifest_ManifestType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
})(Manifest_ManifestType = exports.Manifest_ManifestType || (exports.Manifest_ManifestType = {}));
function manifest_ManifestTypeFromJSON(object) {
    switch (object) {
        case 0:
        case 'MANIFEST_TYPE_UNSPECIFIED':
            return Manifest_ManifestType.MANIFEST_TYPE_UNSPECIFIED;
        case 1:
        case 'DASH':
            return Manifest_ManifestType.DASH;
        case 2:
        case 'HLS':
            return Manifest_ManifestType.HLS;
        case -1:
        case 'UNRECOGNIZED':
        default:
            return Manifest_ManifestType.UNRECOGNIZED;
    }
}
exports.manifest_ManifestTypeFromJSON = manifest_ManifestTypeFromJSON;
function manifest_ManifestTypeToJSON(object) {
    switch (object) {
        case Manifest_ManifestType.MANIFEST_TYPE_UNSPECIFIED:
            return 'MANIFEST_TYPE_UNSPECIFIED';
        case Manifest_ManifestType.DASH:
            return 'DASH';
        case Manifest_ManifestType.HLS:
            return 'HLS';
        default:
            return 'UNKNOWN';
    }
}
exports.manifest_ManifestTypeToJSON = manifest_ManifestTypeToJSON;
const baseManifest = { url: '', type: 0 };
exports.Manifest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.url !== '') {
            writer.uint32(10).string(message.url);
        }
        if (message.type !== 0) {
            writer.uint32(16).int32(message.type);
        }
        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({}, baseManifest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.url = reader.string();
                    break;
                case 2:
                    message.type = reader.int32();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseManifest);
        message.url = object.url !== undefined && object.url !== null ? String(object.url) : '';
        message.type =
            object.type !== undefined && object.type !== null
                ? manifest_ManifestTypeFromJSON(object.type)
                : 0;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.url !== undefined && (obj.url = message.url);
        message.type !== undefined && (obj.type = manifest_ManifestTypeToJSON(message.type));
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseManifest);
        message.url = (_a = object.url) !== null && _a !== void 0 ? _a : '';
        message.type = (_b = object.type) !== null && _b !== void 0 ? _b : 0;
        return message;
    },
};
if (minimal_1.default.util.Long !== long_1.default) {
    minimal_1.default.util.Long = long_1.default;
    minimal_1.default.configure();
}
