// @generated by protobuf-ts 2.11.1 with parameter long_type_string,ts_nocheck
// @generated from protobuf file "runtime/v1/model.proto" (package "nimi.runtime.v1", syntax proto3)
// tslint:disable
// @ts-nocheck
import { Ack } from "./common.js";
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 { ReasonCode } from "./common.js";
import { LocalHostRequirements } from "./local_runtime_types.js";
import { LocalWarmState } from "./local_runtime_types.js";
import { LocalBundleState } from "./local_runtime_types.js";
import { Timestamp } from "../../google/protobuf/timestamp.js";
/**
 * @generated from protobuf enum nimi.runtime.v1.ModelStatus
 */
export var ModelStatus;
(function (ModelStatus) {
    /**
     * @generated from protobuf enum value: MODEL_STATUS_UNSPECIFIED = 0;
     */
    ModelStatus[ModelStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: MODEL_STATUS_INSTALLED = 1;
     */
    ModelStatus[ModelStatus["INSTALLED"] = 1] = "INSTALLED";
    /**
     * @generated from protobuf enum value: MODEL_STATUS_PULLING = 2;
     */
    ModelStatus[ModelStatus["PULLING"] = 2] = "PULLING";
    /**
     * @generated from protobuf enum value: MODEL_STATUS_FAILED = 3;
     */
    ModelStatus[ModelStatus["FAILED"] = 3] = "FAILED";
    /**
     * @generated from protobuf enum value: MODEL_STATUS_REMOVED = 4;
     */
    ModelStatus[ModelStatus["REMOVED"] = 4] = "REMOVED";
})(ModelStatus || (ModelStatus = {}));
// @generated message type with reflection information, may provide speed optimized methods
class ModelCapabilityProfile$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ModelCapabilityProfile", [
            { no: 1, name: "supports_text_generate", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 2, name: "supports_text_stream", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 3, name: "supports_embedding", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 4, name: "supports_image_generation", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 5, name: "supports_video_generation", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 6, name: "supports_speech_synthesis", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 7, name: "supports_speech_transcription", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 8, name: "supports_async_media_job", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 9, name: "supports_streaming", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.supportsTextGenerate = false;
        message.supportsTextStream = false;
        message.supportsEmbedding = false;
        message.supportsImageGeneration = false;
        message.supportsVideoGeneration = false;
        message.supportsSpeechSynthesis = false;
        message.supportsSpeechTranscription = false;
        message.supportsAsyncMediaJob = false;
        message.supportsStreaming = false;
        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 /* bool supports_text_generate */ 1:
                    message.supportsTextGenerate = reader.bool();
                    break;
                case /* bool supports_text_stream */ 2:
                    message.supportsTextStream = reader.bool();
                    break;
                case /* bool supports_embedding */ 3:
                    message.supportsEmbedding = reader.bool();
                    break;
                case /* bool supports_image_generation */ 4:
                    message.supportsImageGeneration = reader.bool();
                    break;
                case /* bool supports_video_generation */ 5:
                    message.supportsVideoGeneration = reader.bool();
                    break;
                case /* bool supports_speech_synthesis */ 6:
                    message.supportsSpeechSynthesis = reader.bool();
                    break;
                case /* bool supports_speech_transcription */ 7:
                    message.supportsSpeechTranscription = reader.bool();
                    break;
                case /* bool supports_async_media_job */ 8:
                    message.supportsAsyncMediaJob = reader.bool();
                    break;
                case /* bool supports_streaming */ 9:
                    message.supportsStreaming = reader.bool();
                    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) {
        /* bool supports_text_generate = 1; */
        if (message.supportsTextGenerate !== false)
            writer.tag(1, WireType.Varint).bool(message.supportsTextGenerate);
        /* bool supports_text_stream = 2; */
        if (message.supportsTextStream !== false)
            writer.tag(2, WireType.Varint).bool(message.supportsTextStream);
        /* bool supports_embedding = 3; */
        if (message.supportsEmbedding !== false)
            writer.tag(3, WireType.Varint).bool(message.supportsEmbedding);
        /* bool supports_image_generation = 4; */
        if (message.supportsImageGeneration !== false)
            writer.tag(4, WireType.Varint).bool(message.supportsImageGeneration);
        /* bool supports_video_generation = 5; */
        if (message.supportsVideoGeneration !== false)
            writer.tag(5, WireType.Varint).bool(message.supportsVideoGeneration);
        /* bool supports_speech_synthesis = 6; */
        if (message.supportsSpeechSynthesis !== false)
            writer.tag(6, WireType.Varint).bool(message.supportsSpeechSynthesis);
        /* bool supports_speech_transcription = 7; */
        if (message.supportsSpeechTranscription !== false)
            writer.tag(7, WireType.Varint).bool(message.supportsSpeechTranscription);
        /* bool supports_async_media_job = 8; */
        if (message.supportsAsyncMediaJob !== false)
            writer.tag(8, WireType.Varint).bool(message.supportsAsyncMediaJob);
        /* bool supports_streaming = 9; */
        if (message.supportsStreaming !== false)
            writer.tag(9, WireType.Varint).bool(message.supportsStreaming);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.ModelCapabilityProfile
 */
export const ModelCapabilityProfile = new ModelCapabilityProfile$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ModelDescriptor$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ModelDescriptor", [
            { no: 1, name: "model_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "status", kind: "enum", T: () => ["nimi.runtime.v1.ModelStatus", ModelStatus, "MODEL_STATUS_"] },
            { no: 4, name: "capabilities", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "last_health_at", kind: "message", T: () => Timestamp },
            { no: 6, name: "capability_profile", kind: "message", T: () => ModelCapabilityProfile },
            { no: 7, name: "logical_model_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 8, name: "family", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 9, name: "artifact_roles", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 10, name: "preferred_engine", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 11, name: "fallback_engines", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 12, name: "bundle_state", kind: "enum", T: () => ["nimi.runtime.v1.LocalBundleState", LocalBundleState, "LOCAL_BUNDLE_STATE_"] },
            { no: 13, name: "warm_state", kind: "enum", T: () => ["nimi.runtime.v1.LocalWarmState", LocalWarmState, "LOCAL_WARM_STATE_"] },
            { no: 14, name: "host_requirements", kind: "message", T: () => LocalHostRequirements }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.modelId = "";
        message.version = "";
        message.status = 0;
        message.capabilities = [];
        message.logicalModelId = "";
        message.family = "";
        message.artifactRoles = [];
        message.preferredEngine = "";
        message.fallbackEngines = [];
        message.bundleState = 0;
        message.warmState = 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 /* string model_id */ 1:
                    message.modelId = reader.string();
                    break;
                case /* string version */ 2:
                    message.version = reader.string();
                    break;
                case /* nimi.runtime.v1.ModelStatus status */ 3:
                    message.status = reader.int32();
                    break;
                case /* repeated string capabilities */ 4:
                    message.capabilities.push(reader.string());
                    break;
                case /* google.protobuf.Timestamp last_health_at */ 5:
                    message.lastHealthAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastHealthAt);
                    break;
                case /* nimi.runtime.v1.ModelCapabilityProfile capability_profile */ 6:
                    message.capabilityProfile = ModelCapabilityProfile.internalBinaryRead(reader, reader.uint32(), options, message.capabilityProfile);
                    break;
                case /* string logical_model_id */ 7:
                    message.logicalModelId = reader.string();
                    break;
                case /* string family */ 8:
                    message.family = reader.string();
                    break;
                case /* repeated string artifact_roles */ 9:
                    message.artifactRoles.push(reader.string());
                    break;
                case /* string preferred_engine */ 10:
                    message.preferredEngine = reader.string();
                    break;
                case /* repeated string fallback_engines */ 11:
                    message.fallbackEngines.push(reader.string());
                    break;
                case /* nimi.runtime.v1.LocalBundleState bundle_state */ 12:
                    message.bundleState = reader.int32();
                    break;
                case /* nimi.runtime.v1.LocalWarmState warm_state */ 13:
                    message.warmState = reader.int32();
                    break;
                case /* nimi.runtime.v1.LocalHostRequirements host_requirements */ 14:
                    message.hostRequirements = LocalHostRequirements.internalBinaryRead(reader, reader.uint32(), options, message.hostRequirements);
                    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 model_id = 1; */
        if (message.modelId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.modelId);
        /* string version = 2; */
        if (message.version !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.version);
        /* nimi.runtime.v1.ModelStatus status = 3; */
        if (message.status !== 0)
            writer.tag(3, WireType.Varint).int32(message.status);
        /* repeated string capabilities = 4; */
        for (let i = 0; i < message.capabilities.length; i++)
            writer.tag(4, WireType.LengthDelimited).string(message.capabilities[i]);
        /* google.protobuf.Timestamp last_health_at = 5; */
        if (message.lastHealthAt)
            Timestamp.internalBinaryWrite(message.lastHealthAt, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* nimi.runtime.v1.ModelCapabilityProfile capability_profile = 6; */
        if (message.capabilityProfile)
            ModelCapabilityProfile.internalBinaryWrite(message.capabilityProfile, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* string logical_model_id = 7; */
        if (message.logicalModelId !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.logicalModelId);
        /* string family = 8; */
        if (message.family !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.family);
        /* repeated string artifact_roles = 9; */
        for (let i = 0; i < message.artifactRoles.length; i++)
            writer.tag(9, WireType.LengthDelimited).string(message.artifactRoles[i]);
        /* string preferred_engine = 10; */
        if (message.preferredEngine !== "")
            writer.tag(10, WireType.LengthDelimited).string(message.preferredEngine);
        /* repeated string fallback_engines = 11; */
        for (let i = 0; i < message.fallbackEngines.length; i++)
            writer.tag(11, WireType.LengthDelimited).string(message.fallbackEngines[i]);
        /* nimi.runtime.v1.LocalBundleState bundle_state = 12; */
        if (message.bundleState !== 0)
            writer.tag(12, WireType.Varint).int32(message.bundleState);
        /* nimi.runtime.v1.LocalWarmState warm_state = 13; */
        if (message.warmState !== 0)
            writer.tag(13, WireType.Varint).int32(message.warmState);
        /* nimi.runtime.v1.LocalHostRequirements host_requirements = 14; */
        if (message.hostRequirements)
            LocalHostRequirements.internalBinaryWrite(message.hostRequirements, writer.tag(14, 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 nimi.runtime.v1.ModelDescriptor
 */
export const ModelDescriptor = new ModelDescriptor$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListModelsRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListModelsRequest", []);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        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) {
                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) {
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.ListModelsRequest
 */
export const ListModelsRequest = new ListModelsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListModelsResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListModelsResponse", [
            { no: 1, name: "models", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ModelDescriptor }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.models = [];
        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 /* repeated nimi.runtime.v1.ModelDescriptor models */ 1:
                    message.models.push(ModelDescriptor.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, writer, options) {
        /* repeated nimi.runtime.v1.ModelDescriptor models = 1; */
        for (let i = 0; i < message.models.length; i++)
            ModelDescriptor.internalBinaryWrite(message.models[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 nimi.runtime.v1.ListModelsResponse
 */
export const ListModelsResponse = new ListModelsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PullModelRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.PullModelRequest", [
            { no: 1, name: "app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "model_ref", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "source", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "digest", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.appId = "";
        message.modelRef = "";
        message.source = "";
        message.digest = "";
        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 app_id */ 1:
                    message.appId = reader.string();
                    break;
                case /* string model_ref */ 2:
                    message.modelRef = reader.string();
                    break;
                case /* string source */ 3:
                    message.source = reader.string();
                    break;
                case /* string digest */ 4:
                    message.digest = 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 app_id = 1; */
        if (message.appId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.appId);
        /* string model_ref = 2; */
        if (message.modelRef !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.modelRef);
        /* string source = 3; */
        if (message.source !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.source);
        /* string digest = 4; */
        if (message.digest !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.digest);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.PullModelRequest
 */
export const PullModelRequest = new PullModelRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PullModelResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.PullModelResponse", [
            { no: 1, name: "task_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "accepted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 3, name: "reason_code", kind: "enum", T: () => ["nimi.runtime.v1.ReasonCode", ReasonCode] }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.taskId = "";
        message.accepted = false;
        message.reasonCode = 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 /* string task_id */ 1:
                    message.taskId = reader.string();
                    break;
                case /* bool accepted */ 2:
                    message.accepted = reader.bool();
                    break;
                case /* nimi.runtime.v1.ReasonCode reason_code */ 3:
                    message.reasonCode = reader.int32();
                    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 task_id = 1; */
        if (message.taskId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.taskId);
        /* bool accepted = 2; */
        if (message.accepted !== false)
            writer.tag(2, WireType.Varint).bool(message.accepted);
        /* nimi.runtime.v1.ReasonCode reason_code = 3; */
        if (message.reasonCode !== 0)
            writer.tag(3, WireType.Varint).int32(message.reasonCode);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.PullModelResponse
 */
export const PullModelResponse = new PullModelResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RemoveModelRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.RemoveModelRequest", [
            { no: 1, name: "app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "model_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.appId = "";
        message.modelId = "";
        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 app_id */ 1:
                    message.appId = reader.string();
                    break;
                case /* string model_id */ 2:
                    message.modelId = 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 app_id = 1; */
        if (message.appId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.appId);
        /* string model_id = 2; */
        if (message.modelId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.modelId);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.RemoveModelRequest
 */
export const RemoveModelRequest = new RemoveModelRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CheckModelHealthRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.CheckModelHealthRequest", [
            { no: 1, name: "model_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.modelId = "";
        message.appId = "";
        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 model_id */ 1:
                    message.modelId = reader.string();
                    break;
                case /* string app_id */ 2:
                    message.appId = 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 model_id = 1; */
        if (message.modelId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.modelId);
        /* string app_id = 2; */
        if (message.appId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.appId);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.CheckModelHealthRequest
 */
export const CheckModelHealthRequest = new CheckModelHealthRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CheckModelHealthResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.CheckModelHealthResponse", [
            { no: 1, name: "healthy", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 2, name: "reason_code", kind: "enum", T: () => ["nimi.runtime.v1.ReasonCode", ReasonCode] },
            { no: 3, name: "action_hint", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.healthy = false;
        message.reasonCode = 0;
        message.actionHint = "";
        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 /* bool healthy */ 1:
                    message.healthy = reader.bool();
                    break;
                case /* nimi.runtime.v1.ReasonCode reason_code */ 2:
                    message.reasonCode = reader.int32();
                    break;
                case /* string action_hint */ 3:
                    message.actionHint = 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) {
        /* bool healthy = 1; */
        if (message.healthy !== false)
            writer.tag(1, WireType.Varint).bool(message.healthy);
        /* nimi.runtime.v1.ReasonCode reason_code = 2; */
        if (message.reasonCode !== 0)
            writer.tag(2, WireType.Varint).int32(message.reasonCode);
        /* string action_hint = 3; */
        if (message.actionHint !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.actionHint);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message nimi.runtime.v1.CheckModelHealthResponse
 */
export const CheckModelHealthResponse = new CheckModelHealthResponse$Type();
/**
 * @generated ServiceType for protobuf service nimi.runtime.v1.RuntimeModelService
 */
export const RuntimeModelService = new ServiceType("nimi.runtime.v1.RuntimeModelService", [
    { name: "ListModels", options: {}, I: ListModelsRequest, O: ListModelsResponse },
    { name: "PullModel", options: {}, I: PullModelRequest, O: PullModelResponse },
    { name: "RemoveModel", options: {}, I: RemoveModelRequest, O: Ack },
    { name: "CheckModelHealth", options: {}, I: CheckModelHealthRequest, O: CheckModelHealthResponse }
]);
//# sourceMappingURL=model.js.map