"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreamLineServiceClient = exports.StreamLineServiceService = exports.UpdateStreamKeyMetadata = exports.UpdateStreamKeyRequest = exports.GetStreamKeyRequest = exports.DeactivateAction = exports.ActivateAction = exports.AutoLineParams = exports.ManualLineParams = exports.RTMPPullParams = exports.RTMPPushParams = exports.PerformLineActionMetadata = exports.PerformLineActionRequest = exports.BatchDeleteStreamLinesMetadata = exports.BatchDeleteStreamLinesRequest = exports.DeleteStreamLineMetadata = exports.DeleteStreamLineRequest = exports.UpdateStreamLineMetadata = exports.UpdateStreamLineRequest_LabelsEntry = exports.UpdateStreamLineRequest = exports.CreateStreamLineMetadata = exports.CreateStreamLineRequest_LabelsEntry = exports.CreateStreamLineRequest = exports.BatchGetStreamLinesResponse = exports.BatchGetStreamLinesRequest = exports.ListStreamLinesResponse = exports.ListStreamLinesRequest = exports.GetStreamLineRequest = exports.protobufPackage = void 0;
/* eslint-disable */
const long_1 = __importDefault(require("long"));
const grpc_js_1 = require("@grpc/grpc-js");
const minimal_1 = __importDefault(require("protobufjs/minimal"));
const field_mask_1 = require("../../../../google/protobuf/field_mask");
const stream_line_1 = require("../../../../yandex/cloud/video/v1/stream_line");
const operation_1 = require("../../../../yandex/cloud/operation/operation");
exports.protobufPackage = 'yandex.cloud.video.v1';
const baseGetStreamLineRequest = { streamLineId: '' };
exports.GetStreamLineRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        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({}, baseGetStreamLineRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseGetStreamLineRequest);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseGetStreamLineRequest);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseListStreamLinesRequest = {
    channelId: '',
    pageSize: 0,
    pageToken: '',
    orderBy: '',
    filter: '',
};
exports.ListStreamLinesRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.channelId !== '') {
            writer.uint32(10).string(message.channelId);
        }
        if (message.pageSize !== 0) {
            writer.uint32(800).int64(message.pageSize);
        }
        if (message.pageToken !== '') {
            writer.uint32(810).string(message.pageToken);
        }
        if (message.orderBy !== '') {
            writer.uint32(818).string(message.orderBy);
        }
        if (message.filter !== '') {
            writer.uint32(826).string(message.filter);
        }
        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({}, baseListStreamLinesRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.channelId = reader.string();
                    break;
                case 100:
                    message.pageSize = longToNumber(reader.int64());
                    break;
                case 101:
                    message.pageToken = reader.string();
                    break;
                case 102:
                    message.orderBy = reader.string();
                    break;
                case 103:
                    message.filter = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseListStreamLinesRequest);
        message.channelId =
            object.channelId !== undefined && object.channelId !== null
                ? String(object.channelId)
                : '';
        message.pageSize =
            object.pageSize !== undefined && object.pageSize !== null ? Number(object.pageSize) : 0;
        message.pageToken =
            object.pageToken !== undefined && object.pageToken !== null
                ? String(object.pageToken)
                : '';
        message.orderBy =
            object.orderBy !== undefined && object.orderBy !== null ? String(object.orderBy) : '';
        message.filter =
            object.filter !== undefined && object.filter !== null ? String(object.filter) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.channelId !== undefined && (obj.channelId = message.channelId);
        message.pageSize !== undefined && (obj.pageSize = Math.round(message.pageSize));
        message.pageToken !== undefined && (obj.pageToken = message.pageToken);
        message.orderBy !== undefined && (obj.orderBy = message.orderBy);
        message.filter !== undefined && (obj.filter = message.filter);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d, _e;
        const message = Object.assign({}, baseListStreamLinesRequest);
        message.channelId = (_a = object.channelId) !== null && _a !== void 0 ? _a : '';
        message.pageSize = (_b = object.pageSize) !== null && _b !== void 0 ? _b : 0;
        message.pageToken = (_c = object.pageToken) !== null && _c !== void 0 ? _c : '';
        message.orderBy = (_d = object.orderBy) !== null && _d !== void 0 ? _d : '';
        message.filter = (_e = object.filter) !== null && _e !== void 0 ? _e : '';
        return message;
    },
};
const baseListStreamLinesResponse = { nextPageToken: '' };
exports.ListStreamLinesResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.streamLines) {
            stream_line_1.StreamLine.encode(v, writer.uint32(10).fork()).ldelim();
        }
        if (message.nextPageToken !== '') {
            writer.uint32(802).string(message.nextPageToken);
        }
        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({}, baseListStreamLinesResponse);
        message.streamLines = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLines.push(stream_line_1.StreamLine.decode(reader, reader.uint32()));
                    break;
                case 100:
                    message.nextPageToken = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseListStreamLinesResponse);
        message.streamLines = ((_a = object.streamLines) !== null && _a !== void 0 ? _a : []).map((e) => stream_line_1.StreamLine.fromJSON(e));
        message.nextPageToken =
            object.nextPageToken !== undefined && object.nextPageToken !== null
                ? String(object.nextPageToken)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.streamLines) {
            obj.streamLines = message.streamLines.map((e) => e ? stream_line_1.StreamLine.toJSON(e) : undefined);
        }
        else {
            obj.streamLines = [];
        }
        message.nextPageToken !== undefined && (obj.nextPageToken = message.nextPageToken);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseListStreamLinesResponse);
        message.streamLines = ((_a = object.streamLines) === null || _a === void 0 ? void 0 : _a.map((e) => stream_line_1.StreamLine.fromPartial(e))) || [];
        message.nextPageToken = (_b = object.nextPageToken) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
const baseBatchGetStreamLinesRequest = { channelId: '', streamLineIds: '' };
exports.BatchGetStreamLinesRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.channelId !== '') {
            writer.uint32(10).string(message.channelId);
        }
        for (const v of message.streamLineIds) {
            writer.uint32(18).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({}, baseBatchGetStreamLinesRequest);
        message.streamLineIds = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.channelId = reader.string();
                    break;
                case 2:
                    message.streamLineIds.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseBatchGetStreamLinesRequest);
        message.channelId =
            object.channelId !== undefined && object.channelId !== null
                ? String(object.channelId)
                : '';
        message.streamLineIds = ((_a = object.streamLineIds) !== null && _a !== void 0 ? _a : []).map((e) => String(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.channelId !== undefined && (obj.channelId = message.channelId);
        if (message.streamLineIds) {
            obj.streamLineIds = message.streamLineIds.map((e) => e);
        }
        else {
            obj.streamLineIds = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseBatchGetStreamLinesRequest);
        message.channelId = (_a = object.channelId) !== null && _a !== void 0 ? _a : '';
        message.streamLineIds = ((_b = object.streamLineIds) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
        return message;
    },
};
const baseBatchGetStreamLinesResponse = {};
exports.BatchGetStreamLinesResponse = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.streamLines) {
            stream_line_1.StreamLine.encode(v, 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({}, baseBatchGetStreamLinesResponse);
        message.streamLines = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLines.push(stream_line_1.StreamLine.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseBatchGetStreamLinesResponse);
        message.streamLines = ((_a = object.streamLines) !== null && _a !== void 0 ? _a : []).map((e) => stream_line_1.StreamLine.fromJSON(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.streamLines) {
            obj.streamLines = message.streamLines.map((e) => e ? stream_line_1.StreamLine.toJSON(e) : undefined);
        }
        else {
            obj.streamLines = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseBatchGetStreamLinesResponse);
        message.streamLines = ((_a = object.streamLines) === null || _a === void 0 ? void 0 : _a.map((e) => stream_line_1.StreamLine.fromPartial(e))) || [];
        return message;
    },
};
const baseCreateStreamLineRequest = { channelId: '', title: '', thumbnailId: '' };
exports.CreateStreamLineRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.channelId !== '') {
            writer.uint32(10).string(message.channelId);
        }
        if (message.title !== '') {
            writer.uint32(18).string(message.title);
        }
        if (message.thumbnailId !== '') {
            writer.uint32(26).string(message.thumbnailId);
        }
        Object.entries(message.labels).forEach(([key, value]) => {
            exports.CreateStreamLineRequest_LabelsEntry.encode({ key: key, value }, writer.uint32(1602).fork()).ldelim();
        });
        if (message.rtmpPush !== undefined) {
            exports.RTMPPushParams.encode(message.rtmpPush, writer.uint32(8002).fork()).ldelim();
        }
        if (message.rtmpPull !== undefined) {
            exports.RTMPPullParams.encode(message.rtmpPull, writer.uint32(8018).fork()).ldelim();
        }
        if (message.manualLine !== undefined) {
            exports.ManualLineParams.encode(message.manualLine, writer.uint32(16002).fork()).ldelim();
        }
        if (message.autoLine !== undefined) {
            exports.AutoLineParams.encode(message.autoLine, writer.uint32(16010).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({}, baseCreateStreamLineRequest);
        message.labels = {};
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.channelId = reader.string();
                    break;
                case 2:
                    message.title = reader.string();
                    break;
                case 3:
                    message.thumbnailId = reader.string();
                    break;
                case 200:
                    const entry200 = exports.CreateStreamLineRequest_LabelsEntry.decode(reader, reader.uint32());
                    if (entry200.value !== undefined) {
                        message.labels[entry200.key] = entry200.value;
                    }
                    break;
                case 1000:
                    message.rtmpPush = exports.RTMPPushParams.decode(reader, reader.uint32());
                    break;
                case 1002:
                    message.rtmpPull = exports.RTMPPullParams.decode(reader, reader.uint32());
                    break;
                case 2000:
                    message.manualLine = exports.ManualLineParams.decode(reader, reader.uint32());
                    break;
                case 2001:
                    message.autoLine = exports.AutoLineParams.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseCreateStreamLineRequest);
        message.channelId =
            object.channelId !== undefined && object.channelId !== null
                ? String(object.channelId)
                : '';
        message.title =
            object.title !== undefined && object.title !== null ? String(object.title) : '';
        message.thumbnailId =
            object.thumbnailId !== undefined && object.thumbnailId !== null
                ? String(object.thumbnailId)
                : '';
        message.labels = Object.entries((_a = object.labels) !== null && _a !== void 0 ? _a : {}).reduce((acc, [key, value]) => {
            acc[key] = String(value);
            return acc;
        }, {});
        message.rtmpPush =
            object.rtmpPush !== undefined && object.rtmpPush !== null
                ? exports.RTMPPushParams.fromJSON(object.rtmpPush)
                : undefined;
        message.rtmpPull =
            object.rtmpPull !== undefined && object.rtmpPull !== null
                ? exports.RTMPPullParams.fromJSON(object.rtmpPull)
                : undefined;
        message.manualLine =
            object.manualLine !== undefined && object.manualLine !== null
                ? exports.ManualLineParams.fromJSON(object.manualLine)
                : undefined;
        message.autoLine =
            object.autoLine !== undefined && object.autoLine !== null
                ? exports.AutoLineParams.fromJSON(object.autoLine)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.channelId !== undefined && (obj.channelId = message.channelId);
        message.title !== undefined && (obj.title = message.title);
        message.thumbnailId !== undefined && (obj.thumbnailId = message.thumbnailId);
        obj.labels = {};
        if (message.labels) {
            Object.entries(message.labels).forEach(([k, v]) => {
                obj.labels[k] = v;
            });
        }
        message.rtmpPush !== undefined &&
            (obj.rtmpPush = message.rtmpPush ? exports.RTMPPushParams.toJSON(message.rtmpPush) : undefined);
        message.rtmpPull !== undefined &&
            (obj.rtmpPull = message.rtmpPull ? exports.RTMPPullParams.toJSON(message.rtmpPull) : undefined);
        message.manualLine !== undefined &&
            (obj.manualLine = message.manualLine
                ? exports.ManualLineParams.toJSON(message.manualLine)
                : undefined);
        message.autoLine !== undefined &&
            (obj.autoLine = message.autoLine ? exports.AutoLineParams.toJSON(message.autoLine) : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d;
        const message = Object.assign({}, baseCreateStreamLineRequest);
        message.channelId = (_a = object.channelId) !== null && _a !== void 0 ? _a : '';
        message.title = (_b = object.title) !== null && _b !== void 0 ? _b : '';
        message.thumbnailId = (_c = object.thumbnailId) !== null && _c !== void 0 ? _c : '';
        message.labels = Object.entries((_d = object.labels) !== null && _d !== void 0 ? _d : {}).reduce((acc, [key, value]) => {
            if (value !== undefined) {
                acc[key] = String(value);
            }
            return acc;
        }, {});
        message.rtmpPush =
            object.rtmpPush !== undefined && object.rtmpPush !== null
                ? exports.RTMPPushParams.fromPartial(object.rtmpPush)
                : undefined;
        message.rtmpPull =
            object.rtmpPull !== undefined && object.rtmpPull !== null
                ? exports.RTMPPullParams.fromPartial(object.rtmpPull)
                : undefined;
        message.manualLine =
            object.manualLine !== undefined && object.manualLine !== null
                ? exports.ManualLineParams.fromPartial(object.manualLine)
                : undefined;
        message.autoLine =
            object.autoLine !== undefined && object.autoLine !== null
                ? exports.AutoLineParams.fromPartial(object.autoLine)
                : undefined;
        return message;
    },
};
const baseCreateStreamLineRequest_LabelsEntry = { key: '', value: '' };
exports.CreateStreamLineRequest_LabelsEntry = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.key !== '') {
            writer.uint32(10).string(message.key);
        }
        if (message.value !== '') {
            writer.uint32(18).string(message.value);
        }
        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({}, baseCreateStreamLineRequest_LabelsEntry);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.key = reader.string();
                    break;
                case 2:
                    message.value = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseCreateStreamLineRequest_LabelsEntry);
        message.key = object.key !== undefined && object.key !== null ? String(object.key) : '';
        message.value =
            object.value !== undefined && object.value !== null ? String(object.value) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.key !== undefined && (obj.key = message.key);
        message.value !== undefined && (obj.value = message.value);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseCreateStreamLineRequest_LabelsEntry);
        message.key = (_a = object.key) !== null && _a !== void 0 ? _a : '';
        message.value = (_b = object.value) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
const baseCreateStreamLineMetadata = { streamLineId: '' };
exports.CreateStreamLineMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        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({}, baseCreateStreamLineMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseCreateStreamLineMetadata);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseCreateStreamLineMetadata);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseUpdateStreamLineRequest = { streamLineId: '', title: '', thumbnailId: '' };
exports.UpdateStreamLineRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        if (message.fieldMask !== undefined) {
            field_mask_1.FieldMask.encode(message.fieldMask, writer.uint32(18).fork()).ldelim();
        }
        if (message.title !== '') {
            writer.uint32(26).string(message.title);
        }
        if (message.thumbnailId !== '') {
            writer.uint32(34).string(message.thumbnailId);
        }
        Object.entries(message.labels).forEach(([key, value]) => {
            exports.UpdateStreamLineRequest_LabelsEntry.encode({ key: key, value }, writer.uint32(1602).fork()).ldelim();
        });
        if (message.rtmpPush !== undefined) {
            exports.RTMPPushParams.encode(message.rtmpPush, writer.uint32(8002).fork()).ldelim();
        }
        if (message.rtmpPull !== undefined) {
            exports.RTMPPullParams.encode(message.rtmpPull, writer.uint32(8018).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({}, baseUpdateStreamLineRequest);
        message.labels = {};
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                case 2:
                    message.fieldMask = field_mask_1.FieldMask.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.title = reader.string();
                    break;
                case 4:
                    message.thumbnailId = reader.string();
                    break;
                case 200:
                    const entry200 = exports.UpdateStreamLineRequest_LabelsEntry.decode(reader, reader.uint32());
                    if (entry200.value !== undefined) {
                        message.labels[entry200.key] = entry200.value;
                    }
                    break;
                case 1000:
                    message.rtmpPush = exports.RTMPPushParams.decode(reader, reader.uint32());
                    break;
                case 1002:
                    message.rtmpPull = exports.RTMPPullParams.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseUpdateStreamLineRequest);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        message.fieldMask =
            object.fieldMask !== undefined && object.fieldMask !== null
                ? field_mask_1.FieldMask.fromJSON(object.fieldMask)
                : undefined;
        message.title =
            object.title !== undefined && object.title !== null ? String(object.title) : '';
        message.thumbnailId =
            object.thumbnailId !== undefined && object.thumbnailId !== null
                ? String(object.thumbnailId)
                : '';
        message.labels = Object.entries((_a = object.labels) !== null && _a !== void 0 ? _a : {}).reduce((acc, [key, value]) => {
            acc[key] = String(value);
            return acc;
        }, {});
        message.rtmpPush =
            object.rtmpPush !== undefined && object.rtmpPush !== null
                ? exports.RTMPPushParams.fromJSON(object.rtmpPush)
                : undefined;
        message.rtmpPull =
            object.rtmpPull !== undefined && object.rtmpPull !== null
                ? exports.RTMPPullParams.fromJSON(object.rtmpPull)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        message.fieldMask !== undefined &&
            (obj.fieldMask = message.fieldMask ? field_mask_1.FieldMask.toJSON(message.fieldMask) : undefined);
        message.title !== undefined && (obj.title = message.title);
        message.thumbnailId !== undefined && (obj.thumbnailId = message.thumbnailId);
        obj.labels = {};
        if (message.labels) {
            Object.entries(message.labels).forEach(([k, v]) => {
                obj.labels[k] = v;
            });
        }
        message.rtmpPush !== undefined &&
            (obj.rtmpPush = message.rtmpPush ? exports.RTMPPushParams.toJSON(message.rtmpPush) : undefined);
        message.rtmpPull !== undefined &&
            (obj.rtmpPull = message.rtmpPull ? exports.RTMPPullParams.toJSON(message.rtmpPull) : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a, _b, _c, _d;
        const message = Object.assign({}, baseUpdateStreamLineRequest);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        message.fieldMask =
            object.fieldMask !== undefined && object.fieldMask !== null
                ? field_mask_1.FieldMask.fromPartial(object.fieldMask)
                : undefined;
        message.title = (_b = object.title) !== null && _b !== void 0 ? _b : '';
        message.thumbnailId = (_c = object.thumbnailId) !== null && _c !== void 0 ? _c : '';
        message.labels = Object.entries((_d = object.labels) !== null && _d !== void 0 ? _d : {}).reduce((acc, [key, value]) => {
            if (value !== undefined) {
                acc[key] = String(value);
            }
            return acc;
        }, {});
        message.rtmpPush =
            object.rtmpPush !== undefined && object.rtmpPush !== null
                ? exports.RTMPPushParams.fromPartial(object.rtmpPush)
                : undefined;
        message.rtmpPull =
            object.rtmpPull !== undefined && object.rtmpPull !== null
                ? exports.RTMPPullParams.fromPartial(object.rtmpPull)
                : undefined;
        return message;
    },
};
const baseUpdateStreamLineRequest_LabelsEntry = { key: '', value: '' };
exports.UpdateStreamLineRequest_LabelsEntry = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.key !== '') {
            writer.uint32(10).string(message.key);
        }
        if (message.value !== '') {
            writer.uint32(18).string(message.value);
        }
        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({}, baseUpdateStreamLineRequest_LabelsEntry);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.key = reader.string();
                    break;
                case 2:
                    message.value = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateStreamLineRequest_LabelsEntry);
        message.key = object.key !== undefined && object.key !== null ? String(object.key) : '';
        message.value =
            object.value !== undefined && object.value !== null ? String(object.value) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.key !== undefined && (obj.key = message.key);
        message.value !== undefined && (obj.value = message.value);
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseUpdateStreamLineRequest_LabelsEntry);
        message.key = (_a = object.key) !== null && _a !== void 0 ? _a : '';
        message.value = (_b = object.value) !== null && _b !== void 0 ? _b : '';
        return message;
    },
};
const baseUpdateStreamLineMetadata = { streamLineId: '' };
exports.UpdateStreamLineMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        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({}, baseUpdateStreamLineMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateStreamLineMetadata);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseUpdateStreamLineMetadata);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteStreamLineRequest = { streamLineId: '' };
exports.DeleteStreamLineRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        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({}, baseDeleteStreamLineRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteStreamLineRequest);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteStreamLineRequest);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseDeleteStreamLineMetadata = { streamLineId: '' };
exports.DeleteStreamLineMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        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({}, baseDeleteStreamLineMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseDeleteStreamLineMetadata);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseDeleteStreamLineMetadata);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseBatchDeleteStreamLinesRequest = { channelId: '', streamLineIds: '' };
exports.BatchDeleteStreamLinesRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.channelId !== '') {
            writer.uint32(10).string(message.channelId);
        }
        for (const v of message.streamLineIds) {
            writer.uint32(18).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({}, baseBatchDeleteStreamLinesRequest);
        message.streamLineIds = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.channelId = reader.string();
                    break;
                case 2:
                    message.streamLineIds.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseBatchDeleteStreamLinesRequest);
        message.channelId =
            object.channelId !== undefined && object.channelId !== null
                ? String(object.channelId)
                : '';
        message.streamLineIds = ((_a = object.streamLineIds) !== null && _a !== void 0 ? _a : []).map((e) => String(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.channelId !== undefined && (obj.channelId = message.channelId);
        if (message.streamLineIds) {
            obj.streamLineIds = message.streamLineIds.map((e) => e);
        }
        else {
            obj.streamLineIds = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a, _b;
        const message = Object.assign({}, baseBatchDeleteStreamLinesRequest);
        message.channelId = (_a = object.channelId) !== null && _a !== void 0 ? _a : '';
        message.streamLineIds = ((_b = object.streamLineIds) === null || _b === void 0 ? void 0 : _b.map((e) => e)) || [];
        return message;
    },
};
const baseBatchDeleteStreamLinesMetadata = { streamLineIds: '' };
exports.BatchDeleteStreamLinesMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        for (const v of message.streamLineIds) {
            writer.uint32(10).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({}, baseBatchDeleteStreamLinesMetadata);
        message.streamLineIds = [];
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineIds.push(reader.string());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        var _a;
        const message = Object.assign({}, baseBatchDeleteStreamLinesMetadata);
        message.streamLineIds = ((_a = object.streamLineIds) !== null && _a !== void 0 ? _a : []).map((e) => String(e));
        return message;
    },
    toJSON(message) {
        const obj = {};
        if (message.streamLineIds) {
            obj.streamLineIds = message.streamLineIds.map((e) => e);
        }
        else {
            obj.streamLineIds = [];
        }
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseBatchDeleteStreamLinesMetadata);
        message.streamLineIds = ((_a = object.streamLineIds) === null || _a === void 0 ? void 0 : _a.map((e) => e)) || [];
        return message;
    },
};
const basePerformLineActionRequest = { streamLineId: '' };
exports.PerformLineActionRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        if (message.activate !== undefined) {
            exports.ActivateAction.encode(message.activate, writer.uint32(8002).fork()).ldelim();
        }
        if (message.deactivate !== undefined) {
            exports.DeactivateAction.encode(message.deactivate, writer.uint32(8010).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({}, basePerformLineActionRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                case 1000:
                    message.activate = exports.ActivateAction.decode(reader, reader.uint32());
                    break;
                case 1001:
                    message.deactivate = exports.DeactivateAction.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, basePerformLineActionRequest);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        message.activate =
            object.activate !== undefined && object.activate !== null
                ? exports.ActivateAction.fromJSON(object.activate)
                : undefined;
        message.deactivate =
            object.deactivate !== undefined && object.deactivate !== null
                ? exports.DeactivateAction.fromJSON(object.deactivate)
                : undefined;
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        message.activate !== undefined &&
            (obj.activate = message.activate ? exports.ActivateAction.toJSON(message.activate) : undefined);
        message.deactivate !== undefined &&
            (obj.deactivate = message.deactivate
                ? exports.DeactivateAction.toJSON(message.deactivate)
                : undefined);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, basePerformLineActionRequest);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        message.activate =
            object.activate !== undefined && object.activate !== null
                ? exports.ActivateAction.fromPartial(object.activate)
                : undefined;
        message.deactivate =
            object.deactivate !== undefined && object.deactivate !== null
                ? exports.DeactivateAction.fromPartial(object.deactivate)
                : undefined;
        return message;
    },
};
const basePerformLineActionMetadata = { streamLineId: '' };
exports.PerformLineActionMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        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({}, basePerformLineActionMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, basePerformLineActionMetadata);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, basePerformLineActionMetadata);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseRTMPPushParams = {};
exports.RTMPPushParams = {
    encode(_, writer = minimal_1.default.Writer.create()) {
        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({}, baseRTMPPushParams);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        const message = Object.assign({}, baseRTMPPushParams);
        return message;
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = Object.assign({}, baseRTMPPushParams);
        return message;
    },
};
const baseRTMPPullParams = { url: '' };
exports.RTMPPullParams = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.url !== '') {
            writer.uint32(10).string(message.url);
        }
        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({}, baseRTMPPullParams);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.url = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseRTMPPullParams);
        message.url = object.url !== undefined && object.url !== null ? String(object.url) : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.url !== undefined && (obj.url = message.url);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseRTMPPullParams);
        message.url = (_a = object.url) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseManualLineParams = {};
exports.ManualLineParams = {
    encode(_, writer = minimal_1.default.Writer.create()) {
        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({}, baseManualLineParams);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        const message = Object.assign({}, baseManualLineParams);
        return message;
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = Object.assign({}, baseManualLineParams);
        return message;
    },
};
const baseAutoLineParams = {};
exports.AutoLineParams = {
    encode(_, writer = minimal_1.default.Writer.create()) {
        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({}, baseAutoLineParams);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        const message = Object.assign({}, baseAutoLineParams);
        return message;
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = Object.assign({}, baseAutoLineParams);
        return message;
    },
};
const baseActivateAction = {};
exports.ActivateAction = {
    encode(_, writer = minimal_1.default.Writer.create()) {
        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({}, baseActivateAction);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        const message = Object.assign({}, baseActivateAction);
        return message;
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = Object.assign({}, baseActivateAction);
        return message;
    },
};
const baseDeactivateAction = {};
exports.DeactivateAction = {
    encode(_, writer = minimal_1.default.Writer.create()) {
        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({}, baseDeactivateAction);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(_) {
        const message = Object.assign({}, baseDeactivateAction);
        return message;
    },
    toJSON(_) {
        const obj = {};
        return obj;
    },
    fromPartial(_) {
        const message = Object.assign({}, baseDeactivateAction);
        return message;
    },
};
const baseGetStreamKeyRequest = { streamLineId: '' };
exports.GetStreamKeyRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        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({}, baseGetStreamKeyRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseGetStreamKeyRequest);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseGetStreamKeyRequest);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseUpdateStreamKeyRequest = { streamLineId: '' };
exports.UpdateStreamKeyRequest = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        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({}, baseUpdateStreamKeyRequest);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateStreamKeyRequest);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseUpdateStreamKeyRequest);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
const baseUpdateStreamKeyMetadata = { streamLineId: '' };
exports.UpdateStreamKeyMetadata = {
    encode(message, writer = minimal_1.default.Writer.create()) {
        if (message.streamLineId !== '') {
            writer.uint32(10).string(message.streamLineId);
        }
        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({}, baseUpdateStreamKeyMetadata);
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.streamLineId = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        const message = Object.assign({}, baseUpdateStreamKeyMetadata);
        message.streamLineId =
            object.streamLineId !== undefined && object.streamLineId !== null
                ? String(object.streamLineId)
                : '';
        return message;
    },
    toJSON(message) {
        const obj = {};
        message.streamLineId !== undefined && (obj.streamLineId = message.streamLineId);
        return obj;
    },
    fromPartial(object) {
        var _a;
        const message = Object.assign({}, baseUpdateStreamKeyMetadata);
        message.streamLineId = (_a = object.streamLineId) !== null && _a !== void 0 ? _a : '';
        return message;
    },
};
/** Stream line management service. */
exports.StreamLineServiceService = {
    /** Get the specific stream line. */
    get: {
        path: '/yandex.cloud.video.v1.StreamLineService/Get',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.GetStreamLineRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.GetStreamLineRequest.decode(value),
        responseSerialize: (value) => Buffer.from(stream_line_1.StreamLine.encode(value).finish()),
        responseDeserialize: (value) => stream_line_1.StreamLine.decode(value),
    },
    /** List lines for channel. */
    list: {
        path: '/yandex.cloud.video.v1.StreamLineService/List',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.ListStreamLinesRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.ListStreamLinesRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.ListStreamLinesResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.ListStreamLinesResponse.decode(value),
    },
    /** Batch get lines for channel. */
    batchGet: {
        path: '/yandex.cloud.video.v1.StreamLineService/BatchGet',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.BatchGetStreamLinesRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.BatchGetStreamLinesRequest.decode(value),
        responseSerialize: (value) => Buffer.from(exports.BatchGetStreamLinesResponse.encode(value).finish()),
        responseDeserialize: (value) => exports.BatchGetStreamLinesResponse.decode(value),
    },
    /** Create stream line. */
    create: {
        path: '/yandex.cloud.video.v1.StreamLineService/Create',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.CreateStreamLineRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.CreateStreamLineRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Update stream line. */
    update: {
        path: '/yandex.cloud.video.v1.StreamLineService/Update',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.UpdateStreamLineRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.UpdateStreamLineRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Delete stream line. */
    delete: {
        path: '/yandex.cloud.video.v1.StreamLineService/Delete',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.DeleteStreamLineRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.DeleteStreamLineRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Batch delete stream lines. */
    batchDelete: {
        path: '/yandex.cloud.video.v1.StreamLineService/BatchDelete',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.BatchDeleteStreamLinesRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.BatchDeleteStreamLinesRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Perform an action on the line. */
    performAction: {
        path: '/yandex.cloud.video.v1.StreamLineService/PerformAction',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.PerformLineActionRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.PerformLineActionRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
    /** Get unique stream key. */
    getStreamKey: {
        path: '/yandex.cloud.video.v1.StreamLineService/GetStreamKey',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.GetStreamKeyRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.GetStreamKeyRequest.decode(value),
        responseSerialize: (value) => Buffer.from(stream_line_1.PushStreamKey.encode(value).finish()),
        responseDeserialize: (value) => stream_line_1.PushStreamKey.decode(value),
    },
    /** Update stream key. */
    updateStreamKey: {
        path: '/yandex.cloud.video.v1.StreamLineService/UpdateStreamKey',
        requestStream: false,
        responseStream: false,
        requestSerialize: (value) => Buffer.from(exports.UpdateStreamKeyRequest.encode(value).finish()),
        requestDeserialize: (value) => exports.UpdateStreamKeyRequest.decode(value),
        responseSerialize: (value) => Buffer.from(operation_1.Operation.encode(value).finish()),
        responseDeserialize: (value) => operation_1.Operation.decode(value),
    },
};
exports.StreamLineServiceClient = (0, grpc_js_1.makeGenericClientConstructor)(exports.StreamLineServiceService, 'yandex.cloud.video.v1.StreamLineService');
var globalThis = (() => {
    if (typeof globalThis !== 'undefined')
        return globalThis;
    if (typeof self !== 'undefined')
        return self;
    if (typeof window !== 'undefined')
        return window;
    if (typeof global !== 'undefined')
        return global;
    throw 'Unable to locate global object';
})();
function longToNumber(long) {
    if (long.gt(Number.MAX_SAFE_INTEGER)) {
        throw new globalThis.Error('Value is larger than Number.MAX_SAFE_INTEGER');
    }
    return long.toNumber();
}
if (minimal_1.default.util.Long !== long_1.default) {
    minimal_1.default.util.Long = long_1.default;
    minimal_1.default.configure();
}
