// @generated by protobuf-ts 2.8.2
// @generated from protobuf file "engines.proto" (package "gooseai", syntax proto3)
// tslint:disable
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MESSAGE_TYPE } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
/**
 * Engine info struct
 *
 * @generated from protobuf message gooseai.EngineInfo
 */
export interface EngineInfo {
    /**
     * @generated from protobuf field: string id = 1;
     */
    id: string;
    /**
     * @generated from protobuf field: string owner = 2;
     */
    owner: string;
    /**
     * @generated from protobuf field: bool ready = 3;
     */
    ready: boolean;
    /**
     * @generated from protobuf field: gooseai.EngineType type = 4;
     */
    type: EngineType;
    /**
     * @generated from protobuf field: gooseai.EngineTokenizer tokenizer = 5;
     */
    tokenizer: EngineTokenizer;
    /**
     * @generated from protobuf field: string name = 6;
     */
    name: string;
    /**
     * @generated from protobuf field: string description = 7;
     */
    description: string;
}
/**
 * Empty
 *
 * @generated from protobuf message gooseai.ListEnginesRequest
 */
export interface ListEnginesRequest {
}
/**
 * Engine info list
 *
 * @generated from protobuf message gooseai.Engines
 */
export interface Engines {
    /**
     * @generated from protobuf field: repeated gooseai.EngineInfo engine = 1;
     */
    engine: EngineInfo[];
}
/**
 * Possible engine type
 *
 * @generated from protobuf enum gooseai.EngineType
 */
export enum EngineType {
    /**
     * @generated from protobuf enum value: TEXT = 0;
     */
    TEXT = 0,
    /**
     * @generated from protobuf enum value: PICTURE = 1;
     */
    PICTURE = 1,
    /**
     * @generated from protobuf enum value: AUDIO = 2;
     */
    AUDIO = 2,
    /**
     * @generated from protobuf enum value: VIDEO = 3;
     */
    VIDEO = 3,
    /**
     * @generated from protobuf enum value: CLASSIFICATION = 4;
     */
    CLASSIFICATION = 4,
    /**
     * @generated from protobuf enum value: STORAGE = 5;
     */
    STORAGE = 5
}
/**
 * @generated from protobuf enum gooseai.EngineTokenizer
 */
export enum EngineTokenizer {
    /**
     * @generated from protobuf enum value: GPT2 = 0;
     */
    GPT2 = 0,
    /**
     * @generated from protobuf enum value: PILE = 1;
     */
    PILE = 1
}
// @generated message type with reflection information, may provide speed optimized methods
class EngineInfo$Type extends MessageType<EngineInfo> {
    constructor() {
        super("gooseai.EngineInfo", [
            { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "owner", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "ready", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 4, name: "type", kind: "enum", T: () => ["gooseai.EngineType", EngineType] },
            { no: 5, name: "tokenizer", kind: "enum", T: () => ["gooseai.EngineTokenizer", EngineTokenizer] },
            { no: 6, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<EngineInfo>): EngineInfo {
        const message = { id: "", owner: "", ready: false, type: 0, tokenizer: 0, name: "", description: "" };
        globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
        if (value !== undefined)
            reflectionMergePartial<EngineInfo>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EngineInfo): EngineInfo {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string id */ 1:
                    message.id = reader.string();
                    break;
                case /* string owner */ 2:
                    message.owner = reader.string();
                    break;
                case /* bool ready */ 3:
                    message.ready = reader.bool();
                    break;
                case /* gooseai.EngineType type */ 4:
                    message.type = reader.int32();
                    break;
                case /* gooseai.EngineTokenizer tokenizer */ 5:
                    message.tokenizer = reader.int32();
                    break;
                case /* string name */ 6:
                    message.name = reader.string();
                    break;
                case /* string description */ 7:
                    message.description = 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: EngineInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string id = 1; */
        if (message.id !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.id);
        /* string owner = 2; */
        if (message.owner !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.owner);
        /* bool ready = 3; */
        if (message.ready !== false)
            writer.tag(3, WireType.Varint).bool(message.ready);
        /* gooseai.EngineType type = 4; */
        if (message.type !== 0)
            writer.tag(4, WireType.Varint).int32(message.type);
        /* gooseai.EngineTokenizer tokenizer = 5; */
        if (message.tokenizer !== 0)
            writer.tag(5, WireType.Varint).int32(message.tokenizer);
        /* string name = 6; */
        if (message.name !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.name);
        /* string description = 7; */
        if (message.description !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.description);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message gooseai.EngineInfo
 */
export const EngineInfo = new EngineInfo$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListEnginesRequest$Type extends MessageType<ListEnginesRequest> {
    constructor() {
        super("gooseai.ListEnginesRequest", []);
    }
    create(value?: PartialMessage<ListEnginesRequest>): ListEnginesRequest {
        const message = {};
        globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
        if (value !== undefined)
            reflectionMergePartial<ListEnginesRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListEnginesRequest): ListEnginesRequest {
        return target ?? this.create();
    }
    internalBinaryWrite(message: ListEnginesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message gooseai.ListEnginesRequest
 */
export const ListEnginesRequest = new ListEnginesRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Engines$Type extends MessageType<Engines> {
    constructor() {
        super("gooseai.Engines", [
            { no: 1, name: "engine", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => EngineInfo }
        ]);
    }
    create(value?: PartialMessage<Engines>): Engines {
        const message = { engine: [] };
        globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this });
        if (value !== undefined)
            reflectionMergePartial<Engines>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Engines): Engines {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated gooseai.EngineInfo engine */ 1:
                    message.engine.push(EngineInfo.internalBinaryRead(reader, reader.uint32(), options));
                    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: Engines, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated gooseai.EngineInfo engine = 1; */
        for (let i = 0; i < message.engine.length; i++)
            EngineInfo.internalBinaryWrite(message.engine[i], writer.tag(1, 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 gooseai.Engines
 */
export const Engines = new Engines$Type();
/**
 * @generated ServiceType for protobuf service gooseai.EnginesService
 */
export const EnginesService = new ServiceType("gooseai.EnginesService", [
    { name: "ListEngines", options: {}, I: ListEnginesRequest, O: Engines }
]);
