/* eslint-disable */
import _m0 from "protobufjs/minimal";
import { SignatureCounts } from "../types/monitoring";
export const protobufPackage = "tendermint.spn.monitoringp";
function createBaseMonitoringInfo() {
    return { transmitted: false, signatureCounts: undefined };
}
export const MonitoringInfo = {
    encode(message, writer = _m0.Writer.create()) {
        if (message.transmitted === true) {
            writer.uint32(8).bool(message.transmitted);
        }
        if (message.signatureCounts !== undefined) {
            SignatureCounts.encode(message.signatureCounts, writer.uint32(18).fork()).ldelim();
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseMonitoringInfo();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.transmitted = reader.bool();
                    break;
                case 2:
                    message.signatureCounts = SignatureCounts.decode(reader, reader.uint32());
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            transmitted: isSet(object.transmitted) ? Boolean(object.transmitted) : false,
            signatureCounts: isSet(object.signatureCounts) ? SignatureCounts.fromJSON(object.signatureCounts) : undefined,
        };
    },
    toJSON(message) {
        const obj = {};
        message.transmitted !== undefined && (obj.transmitted = message.transmitted);
        message.signatureCounts !== undefined
            && (obj.signatureCounts = message.signatureCounts ? SignatureCounts.toJSON(message.signatureCounts) : undefined);
        return obj;
    },
    fromPartial(object) {
        const message = createBaseMonitoringInfo();
        message.transmitted = object.transmitted ?? false;
        message.signatureCounts = (object.signatureCounts !== undefined && object.signatureCounts !== null)
            ? SignatureCounts.fromPartial(object.signatureCounts)
            : undefined;
        return message;
    },
};
function isSet(value) {
    return value !== null && value !== undefined;
}
//# sourceMappingURL=monitoring_info.js.map