/* eslint-disable */
// @generated by protobuf-ts 2.11.1 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable
// @generated from protobuf file "runme/notebook/v1alpha1/notebook.proto" (package "runme.notebook.v1alpha1", syntax proto3)
// tslint:disable
// @ts-nocheck
/* eslint-disable */
// @generated by protobuf-ts 2.11.1 with parameter output_javascript,optimize_code_size,long_type_string,add_pb_suffix,ts_nocheck,eslint_disable
// @generated from protobuf file "runme/notebook/v1alpha1/notebook.proto" (package "runme.notebook.v1alpha1", syntax proto3)
// tslint:disable
// @ts-nocheck
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import { WireType } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { UInt32Value } from "../../../google/protobuf/wrappers_pb";
import { CommandMode } from "../../runner/v1/runner_pb";
import { Notebook } from "../../parser/v1/parser_pb";
// @generated message type with reflection information, may provide speed optimized methods
class ResolveNotebookRequest$Type extends MessageType {
    constructor() {
        super("runme.notebook.v1alpha1.ResolveNotebookRequest", [
            { no: 1, name: "notebook", kind: "message", T: () => Notebook },
            { no: 2, name: "command_mode", kind: "enum", T: () => ["runme.runner.v1.CommandMode", CommandMode, "COMMAND_MODE_"] },
            { no: 3, name: "cell_index", kind: "message", T: () => UInt32Value }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.commandMode = 0;
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* runme.parser.v1.Notebook notebook */ 1:
                    message.notebook = Notebook.internalBinaryRead(reader, reader.uint32(), options, message.notebook);
                    break;
                case /* runme.runner.v1.CommandMode command_mode */ 2:
                    message.commandMode = reader.int32();
                    break;
                case /* google.protobuf.UInt32Value cell_index */ 3:
                    message.cellIndex = UInt32Value.internalBinaryRead(reader, reader.uint32(), options, message.cellIndex);
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* runme.parser.v1.Notebook notebook = 1; */
        if (message.notebook)
            Notebook.internalBinaryWrite(message.notebook, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* runme.runner.v1.CommandMode command_mode = 2; */
        if (message.commandMode !== 0)
            writer.tag(2, WireType.Varint).int32(message.commandMode);
        /* google.protobuf.UInt32Value cell_index = 3; */
        if (message.cellIndex)
            UInt32Value.internalBinaryWrite(message.cellIndex, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.notebook.v1alpha1.ResolveNotebookRequest
 */
export const ResolveNotebookRequest = new ResolveNotebookRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ResolveNotebookResponse$Type extends MessageType {
    constructor() {
        super("runme.notebook.v1alpha1.ResolveNotebookResponse", [
            { no: 1, name: "script", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.script = "";
        if (value !== undefined)
            reflectionMergePartial(this, message, value);
        return message;
    }
    internalBinaryRead(reader, length, options, target) {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string script */ 1:
                    message.script = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message, writer, options) {
        /* string script = 1; */
        if (message.script !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.script);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message runme.notebook.v1alpha1.ResolveNotebookResponse
 */
export const ResolveNotebookResponse = new ResolveNotebookResponse$Type();
/**
 * @generated ServiceType for protobuf service runme.notebook.v1alpha1.NotebookService
 */
export const NotebookService = new ServiceType("runme.notebook.v1alpha1.NotebookService", [
    { name: "ResolveNotebook", options: {}, I: ResolveNotebookRequest, O: ResolveNotebookResponse }
]);
