// @generated by protobuf-ts 2.11.1 with parameter long_type_string,ts_nocheck
// @generated from protobuf file "runtime/v1/audit.proto" (package "nimi.runtime.v1", 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 { Struct } from "../../google/protobuf/struct.js";
import { CallerKind } from "./common.js";
import { Timestamp } from "../../google/protobuf/timestamp.js";
import { ReasonCode } from "./common.js";
/**
 * @generated from protobuf enum nimi.runtime.v1.UsageWindow
 */
export var UsageWindow;
(function (UsageWindow) {
    /**
     * @generated from protobuf enum value: USAGE_WINDOW_UNSPECIFIED = 0;
     */
    UsageWindow[UsageWindow["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: USAGE_WINDOW_MINUTE = 1;
     */
    UsageWindow[UsageWindow["MINUTE"] = 1] = "MINUTE";
    /**
     * @generated from protobuf enum value: USAGE_WINDOW_HOUR = 2;
     */
    UsageWindow[UsageWindow["HOUR"] = 2] = "HOUR";
    /**
     * @generated from protobuf enum value: USAGE_WINDOW_DAY = 3;
     */
    UsageWindow[UsageWindow["DAY"] = 3] = "DAY";
})(UsageWindow || (UsageWindow = {}));
/**
 * @generated from protobuf enum nimi.runtime.v1.RuntimeHealthStatus
 */
export var RuntimeHealthStatus;
(function (RuntimeHealthStatus) {
    /**
     * @generated from protobuf enum value: RUNTIME_HEALTH_STATUS_UNSPECIFIED = 0;
     */
    RuntimeHealthStatus[RuntimeHealthStatus["UNSPECIFIED"] = 0] = "UNSPECIFIED";
    /**
     * @generated from protobuf enum value: RUNTIME_HEALTH_STATUS_STOPPED = 1;
     */
    RuntimeHealthStatus[RuntimeHealthStatus["STOPPED"] = 1] = "STOPPED";
    /**
     * @generated from protobuf enum value: RUNTIME_HEALTH_STATUS_STARTING = 2;
     */
    RuntimeHealthStatus[RuntimeHealthStatus["STARTING"] = 2] = "STARTING";
    /**
     * @generated from protobuf enum value: RUNTIME_HEALTH_STATUS_READY = 3;
     */
    RuntimeHealthStatus[RuntimeHealthStatus["READY"] = 3] = "READY";
    /**
     * @generated from protobuf enum value: RUNTIME_HEALTH_STATUS_DEGRADED = 4;
     */
    RuntimeHealthStatus[RuntimeHealthStatus["DEGRADED"] = 4] = "DEGRADED";
    /**
     * @generated from protobuf enum value: RUNTIME_HEALTH_STATUS_STOPPING = 5;
     */
    RuntimeHealthStatus[RuntimeHealthStatus["STOPPING"] = 5] = "STOPPING";
})(RuntimeHealthStatus || (RuntimeHealthStatus = {}));
// @generated message type with reflection information, may provide speed optimized methods
class ListAuditEventsRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListAuditEventsRequest", [
            { no: 1, name: "app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "subject_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "domain", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "reason_code", kind: "enum", T: () => ["nimi.runtime.v1.ReasonCode", ReasonCode] },
            { no: 5, name: "from_time", kind: "message", T: () => Timestamp },
            { no: 6, name: "to_time", kind: "message", T: () => Timestamp },
            { no: 7, name: "page_size", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 8, name: "page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 9, name: "caller_kind", kind: "enum", T: () => ["nimi.runtime.v1.CallerKind", CallerKind, "CALLER_KIND_"] },
            { no: 10, name: "caller_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.appId = "";
        message.subjectUserId = "";
        message.domain = "";
        message.reasonCode = 0;
        message.pageSize = 0;
        message.pageToken = "";
        message.callerKind = 0;
        message.callerId = "";
        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 subject_user_id */ 2:
                    message.subjectUserId = reader.string();
                    break;
                case /* string domain */ 3:
                    message.domain = reader.string();
                    break;
                case /* nimi.runtime.v1.ReasonCode reason_code */ 4:
                    message.reasonCode = reader.int32();
                    break;
                case /* google.protobuf.Timestamp from_time */ 5:
                    message.fromTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.fromTime);
                    break;
                case /* google.protobuf.Timestamp to_time */ 6:
                    message.toTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.toTime);
                    break;
                case /* int32 page_size */ 7:
                    message.pageSize = reader.int32();
                    break;
                case /* string page_token */ 8:
                    message.pageToken = reader.string();
                    break;
                case /* nimi.runtime.v1.CallerKind caller_kind */ 9:
                    message.callerKind = reader.int32();
                    break;
                case /* string caller_id */ 10:
                    message.callerId = 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 subject_user_id = 2; */
        if (message.subjectUserId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.subjectUserId);
        /* string domain = 3; */
        if (message.domain !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.domain);
        /* nimi.runtime.v1.ReasonCode reason_code = 4; */
        if (message.reasonCode !== 0)
            writer.tag(4, WireType.Varint).int32(message.reasonCode);
        /* google.protobuf.Timestamp from_time = 5; */
        if (message.fromTime)
            Timestamp.internalBinaryWrite(message.fromTime, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.Timestamp to_time = 6; */
        if (message.toTime)
            Timestamp.internalBinaryWrite(message.toTime, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* int32 page_size = 7; */
        if (message.pageSize !== 0)
            writer.tag(7, WireType.Varint).int32(message.pageSize);
        /* string page_token = 8; */
        if (message.pageToken !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.pageToken);
        /* nimi.runtime.v1.CallerKind caller_kind = 9; */
        if (message.callerKind !== 0)
            writer.tag(9, WireType.Varint).int32(message.callerKind);
        /* string caller_id = 10; */
        if (message.callerId !== "")
            writer.tag(10, WireType.LengthDelimited).string(message.callerId);
        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.ListAuditEventsRequest
 */
export const ListAuditEventsRequest = new ListAuditEventsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AuditEventRecord$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.AuditEventRecord", [
            { no: 1, name: "audit_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "subject_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "domain", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "operation", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 6, name: "reason_code", kind: "enum", T: () => ["nimi.runtime.v1.ReasonCode", ReasonCode] },
            { no: 7, name: "trace_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 8, name: "timestamp", kind: "message", T: () => Timestamp },
            { no: 9, name: "payload", kind: "message", T: () => Struct },
            { no: 10, name: "caller_kind", kind: "enum", T: () => ["nimi.runtime.v1.CallerKind", CallerKind, "CALLER_KIND_"] },
            { no: 11, name: "caller_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 12, name: "surface_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 13, name: "principal_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 14, name: "principal_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 15, name: "external_principal_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 16, name: "capability", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 17, name: "token_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 18, name: "parent_token_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 19, name: "consent_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 20, name: "consent_version", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 21, name: "policy_version", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 22, name: "resource_selector_hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 23, name: "scope_catalog_version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.auditId = "";
        message.appId = "";
        message.subjectUserId = "";
        message.domain = "";
        message.operation = "";
        message.reasonCode = 0;
        message.traceId = "";
        message.callerKind = 0;
        message.callerId = "";
        message.surfaceId = "";
        message.principalId = "";
        message.principalType = "";
        message.externalPrincipalType = "";
        message.capability = "";
        message.tokenId = "";
        message.parentTokenId = "";
        message.consentId = "";
        message.consentVersion = "";
        message.policyVersion = "";
        message.resourceSelectorHash = "";
        message.scopeCatalogVersion = "";
        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 audit_id */ 1:
                    message.auditId = reader.string();
                    break;
                case /* string app_id */ 2:
                    message.appId = reader.string();
                    break;
                case /* string subject_user_id */ 3:
                    message.subjectUserId = reader.string();
                    break;
                case /* string domain */ 4:
                    message.domain = reader.string();
                    break;
                case /* string operation */ 5:
                    message.operation = reader.string();
                    break;
                case /* nimi.runtime.v1.ReasonCode reason_code */ 6:
                    message.reasonCode = reader.int32();
                    break;
                case /* string trace_id */ 7:
                    message.traceId = reader.string();
                    break;
                case /* google.protobuf.Timestamp timestamp */ 8:
                    message.timestamp = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.timestamp);
                    break;
                case /* google.protobuf.Struct payload */ 9:
                    message.payload = Struct.internalBinaryRead(reader, reader.uint32(), options, message.payload);
                    break;
                case /* nimi.runtime.v1.CallerKind caller_kind */ 10:
                    message.callerKind = reader.int32();
                    break;
                case /* string caller_id */ 11:
                    message.callerId = reader.string();
                    break;
                case /* string surface_id */ 12:
                    message.surfaceId = reader.string();
                    break;
                case /* string principal_id */ 13:
                    message.principalId = reader.string();
                    break;
                case /* string principal_type */ 14:
                    message.principalType = reader.string();
                    break;
                case /* string external_principal_type */ 15:
                    message.externalPrincipalType = reader.string();
                    break;
                case /* string capability */ 16:
                    message.capability = reader.string();
                    break;
                case /* string token_id */ 17:
                    message.tokenId = reader.string();
                    break;
                case /* string parent_token_id */ 18:
                    message.parentTokenId = reader.string();
                    break;
                case /* string consent_id */ 19:
                    message.consentId = reader.string();
                    break;
                case /* string consent_version */ 20:
                    message.consentVersion = reader.string();
                    break;
                case /* string policy_version */ 21:
                    message.policyVersion = reader.string();
                    break;
                case /* string resource_selector_hash */ 22:
                    message.resourceSelectorHash = reader.string();
                    break;
                case /* string scope_catalog_version */ 23:
                    message.scopeCatalogVersion = 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 audit_id = 1; */
        if (message.auditId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.auditId);
        /* string app_id = 2; */
        if (message.appId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.appId);
        /* string subject_user_id = 3; */
        if (message.subjectUserId !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.subjectUserId);
        /* string domain = 4; */
        if (message.domain !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.domain);
        /* string operation = 5; */
        if (message.operation !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.operation);
        /* nimi.runtime.v1.ReasonCode reason_code = 6; */
        if (message.reasonCode !== 0)
            writer.tag(6, WireType.Varint).int32(message.reasonCode);
        /* string trace_id = 7; */
        if (message.traceId !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.traceId);
        /* google.protobuf.Timestamp timestamp = 8; */
        if (message.timestamp)
            Timestamp.internalBinaryWrite(message.timestamp, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.Struct payload = 9; */
        if (message.payload)
            Struct.internalBinaryWrite(message.payload, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
        /* nimi.runtime.v1.CallerKind caller_kind = 10; */
        if (message.callerKind !== 0)
            writer.tag(10, WireType.Varint).int32(message.callerKind);
        /* string caller_id = 11; */
        if (message.callerId !== "")
            writer.tag(11, WireType.LengthDelimited).string(message.callerId);
        /* string surface_id = 12; */
        if (message.surfaceId !== "")
            writer.tag(12, WireType.LengthDelimited).string(message.surfaceId);
        /* string principal_id = 13; */
        if (message.principalId !== "")
            writer.tag(13, WireType.LengthDelimited).string(message.principalId);
        /* string principal_type = 14; */
        if (message.principalType !== "")
            writer.tag(14, WireType.LengthDelimited).string(message.principalType);
        /* string external_principal_type = 15; */
        if (message.externalPrincipalType !== "")
            writer.tag(15, WireType.LengthDelimited).string(message.externalPrincipalType);
        /* string capability = 16; */
        if (message.capability !== "")
            writer.tag(16, WireType.LengthDelimited).string(message.capability);
        /* string token_id = 17; */
        if (message.tokenId !== "")
            writer.tag(17, WireType.LengthDelimited).string(message.tokenId);
        /* string parent_token_id = 18; */
        if (message.parentTokenId !== "")
            writer.tag(18, WireType.LengthDelimited).string(message.parentTokenId);
        /* string consent_id = 19; */
        if (message.consentId !== "")
            writer.tag(19, WireType.LengthDelimited).string(message.consentId);
        /* string consent_version = 20; */
        if (message.consentVersion !== "")
            writer.tag(20, WireType.LengthDelimited).string(message.consentVersion);
        /* string policy_version = 21; */
        if (message.policyVersion !== "")
            writer.tag(21, WireType.LengthDelimited).string(message.policyVersion);
        /* string resource_selector_hash = 22; */
        if (message.resourceSelectorHash !== "")
            writer.tag(22, WireType.LengthDelimited).string(message.resourceSelectorHash);
        /* string scope_catalog_version = 23; */
        if (message.scopeCatalogVersion !== "")
            writer.tag(23, WireType.LengthDelimited).string(message.scopeCatalogVersion);
        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.AuditEventRecord
 */
export const AuditEventRecord = new AuditEventRecord$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListAuditEventsResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListAuditEventsResponse", [
            { no: 1, name: "events", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => AuditEventRecord },
            { no: 2, name: "next_page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.events = [];
        message.nextPageToken = "";
        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.AuditEventRecord events */ 1:
                    message.events.push(AuditEventRecord.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* string next_page_token */ 2:
                    message.nextPageToken = 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) {
        /* repeated nimi.runtime.v1.AuditEventRecord events = 1; */
        for (let i = 0; i < message.events.length; i++)
            AuditEventRecord.internalBinaryWrite(message.events[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* string next_page_token = 2; */
        if (message.nextPageToken !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.nextPageToken);
        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.ListAuditEventsResponse
 */
export const ListAuditEventsResponse = new ListAuditEventsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExportAuditEventsRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ExportAuditEventsRequest", [
            { no: 1, name: "app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "subject_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "format", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "from_time", kind: "message", T: () => Timestamp },
            { no: 5, name: "to_time", kind: "message", T: () => Timestamp },
            { no: 6, name: "compress", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.appId = "";
        message.subjectUserId = "";
        message.format = "";
        message.compress = 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 /* string app_id */ 1:
                    message.appId = reader.string();
                    break;
                case /* string subject_user_id */ 2:
                    message.subjectUserId = reader.string();
                    break;
                case /* string format */ 3:
                    message.format = reader.string();
                    break;
                case /* google.protobuf.Timestamp from_time */ 4:
                    message.fromTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.fromTime);
                    break;
                case /* google.protobuf.Timestamp to_time */ 5:
                    message.toTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.toTime);
                    break;
                case /* bool compress */ 6:
                    message.compress = 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) {
        /* string app_id = 1; */
        if (message.appId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.appId);
        /* string subject_user_id = 2; */
        if (message.subjectUserId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.subjectUserId);
        /* string format = 3; */
        if (message.format !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.format);
        /* google.protobuf.Timestamp from_time = 4; */
        if (message.fromTime)
            Timestamp.internalBinaryWrite(message.fromTime, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.Timestamp to_time = 5; */
        if (message.toTime)
            Timestamp.internalBinaryWrite(message.toTime, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* bool compress = 6; */
        if (message.compress !== false)
            writer.tag(6, WireType.Varint).bool(message.compress);
        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.ExportAuditEventsRequest
 */
export const ExportAuditEventsRequest = new ExportAuditEventsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListUsageStatsRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListUsageStatsRequest", [
            { no: 1, name: "app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "subject_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "caller_kind", kind: "enum", T: () => ["nimi.runtime.v1.CallerKind", CallerKind, "CALLER_KIND_"] },
            { no: 4, name: "caller_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "capability", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 6, name: "model_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "window", kind: "enum", T: () => ["nimi.runtime.v1.UsageWindow", UsageWindow, "USAGE_WINDOW_"] },
            { no: 8, name: "from_time", kind: "message", T: () => Timestamp },
            { no: 9, name: "to_time", kind: "message", T: () => Timestamp },
            { no: 10, name: "page_size", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 11, name: "page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.appId = "";
        message.subjectUserId = "";
        message.callerKind = 0;
        message.callerId = "";
        message.capability = "";
        message.modelId = "";
        message.window = 0;
        message.pageSize = 0;
        message.pageToken = "";
        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 subject_user_id */ 2:
                    message.subjectUserId = reader.string();
                    break;
                case /* nimi.runtime.v1.CallerKind caller_kind */ 3:
                    message.callerKind = reader.int32();
                    break;
                case /* string caller_id */ 4:
                    message.callerId = reader.string();
                    break;
                case /* string capability */ 5:
                    message.capability = reader.string();
                    break;
                case /* string model_id */ 6:
                    message.modelId = reader.string();
                    break;
                case /* nimi.runtime.v1.UsageWindow window */ 7:
                    message.window = reader.int32();
                    break;
                case /* google.protobuf.Timestamp from_time */ 8:
                    message.fromTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.fromTime);
                    break;
                case /* google.protobuf.Timestamp to_time */ 9:
                    message.toTime = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.toTime);
                    break;
                case /* int32 page_size */ 10:
                    message.pageSize = reader.int32();
                    break;
                case /* string page_token */ 11:
                    message.pageToken = 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 subject_user_id = 2; */
        if (message.subjectUserId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.subjectUserId);
        /* nimi.runtime.v1.CallerKind caller_kind = 3; */
        if (message.callerKind !== 0)
            writer.tag(3, WireType.Varint).int32(message.callerKind);
        /* string caller_id = 4; */
        if (message.callerId !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.callerId);
        /* string capability = 5; */
        if (message.capability !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.capability);
        /* string model_id = 6; */
        if (message.modelId !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.modelId);
        /* nimi.runtime.v1.UsageWindow window = 7; */
        if (message.window !== 0)
            writer.tag(7, WireType.Varint).int32(message.window);
        /* google.protobuf.Timestamp from_time = 8; */
        if (message.fromTime)
            Timestamp.internalBinaryWrite(message.fromTime, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.Timestamp to_time = 9; */
        if (message.toTime)
            Timestamp.internalBinaryWrite(message.toTime, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
        /* int32 page_size = 10; */
        if (message.pageSize !== 0)
            writer.tag(10, WireType.Varint).int32(message.pageSize);
        /* string page_token = 11; */
        if (message.pageToken !== "")
            writer.tag(11, WireType.LengthDelimited).string(message.pageToken);
        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.ListUsageStatsRequest
 */
export const ListUsageStatsRequest = new ListUsageStatsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UsageStatRecord$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.UsageStatRecord", [
            { no: 1, name: "app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "subject_user_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "caller_kind", kind: "enum", T: () => ["nimi.runtime.v1.CallerKind", CallerKind, "CALLER_KIND_"] },
            { no: 4, name: "caller_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "capability", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 6, name: "model_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "window", kind: "enum", T: () => ["nimi.runtime.v1.UsageWindow", UsageWindow, "USAGE_WINDOW_"] },
            { no: 8, name: "bucket_start", kind: "message", T: () => Timestamp },
            { no: 9, name: "request_count", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 10, name: "success_count", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 11, name: "error_count", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 12, name: "input_tokens", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 13, name: "output_tokens", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 14, name: "compute_ms", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 15, name: "queue_wait_ms", kind: "scalar", T: 3 /*ScalarType.INT64*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.appId = "";
        message.subjectUserId = "";
        message.callerKind = 0;
        message.callerId = "";
        message.capability = "";
        message.modelId = "";
        message.window = 0;
        message.requestCount = "0";
        message.successCount = "0";
        message.errorCount = "0";
        message.inputTokens = "0";
        message.outputTokens = "0";
        message.computeMs = "0";
        message.queueWaitMs = "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 app_id */ 1:
                    message.appId = reader.string();
                    break;
                case /* string subject_user_id */ 2:
                    message.subjectUserId = reader.string();
                    break;
                case /* nimi.runtime.v1.CallerKind caller_kind */ 3:
                    message.callerKind = reader.int32();
                    break;
                case /* string caller_id */ 4:
                    message.callerId = reader.string();
                    break;
                case /* string capability */ 5:
                    message.capability = reader.string();
                    break;
                case /* string model_id */ 6:
                    message.modelId = reader.string();
                    break;
                case /* nimi.runtime.v1.UsageWindow window */ 7:
                    message.window = reader.int32();
                    break;
                case /* google.protobuf.Timestamp bucket_start */ 8:
                    message.bucketStart = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.bucketStart);
                    break;
                case /* int64 request_count */ 9:
                    message.requestCount = reader.int64().toString();
                    break;
                case /* int64 success_count */ 10:
                    message.successCount = reader.int64().toString();
                    break;
                case /* int64 error_count */ 11:
                    message.errorCount = reader.int64().toString();
                    break;
                case /* int64 input_tokens */ 12:
                    message.inputTokens = reader.int64().toString();
                    break;
                case /* int64 output_tokens */ 13:
                    message.outputTokens = reader.int64().toString();
                    break;
                case /* int64 compute_ms */ 14:
                    message.computeMs = reader.int64().toString();
                    break;
                case /* int64 queue_wait_ms */ 15:
                    message.queueWaitMs = reader.int64().toString();
                    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 subject_user_id = 2; */
        if (message.subjectUserId !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.subjectUserId);
        /* nimi.runtime.v1.CallerKind caller_kind = 3; */
        if (message.callerKind !== 0)
            writer.tag(3, WireType.Varint).int32(message.callerKind);
        /* string caller_id = 4; */
        if (message.callerId !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.callerId);
        /* string capability = 5; */
        if (message.capability !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.capability);
        /* string model_id = 6; */
        if (message.modelId !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.modelId);
        /* nimi.runtime.v1.UsageWindow window = 7; */
        if (message.window !== 0)
            writer.tag(7, WireType.Varint).int32(message.window);
        /* google.protobuf.Timestamp bucket_start = 8; */
        if (message.bucketStart)
            Timestamp.internalBinaryWrite(message.bucketStart, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
        /* int64 request_count = 9; */
        if (message.requestCount !== "0")
            writer.tag(9, WireType.Varint).int64(message.requestCount);
        /* int64 success_count = 10; */
        if (message.successCount !== "0")
            writer.tag(10, WireType.Varint).int64(message.successCount);
        /* int64 error_count = 11; */
        if (message.errorCount !== "0")
            writer.tag(11, WireType.Varint).int64(message.errorCount);
        /* int64 input_tokens = 12; */
        if (message.inputTokens !== "0")
            writer.tag(12, WireType.Varint).int64(message.inputTokens);
        /* int64 output_tokens = 13; */
        if (message.outputTokens !== "0")
            writer.tag(13, WireType.Varint).int64(message.outputTokens);
        /* int64 compute_ms = 14; */
        if (message.computeMs !== "0")
            writer.tag(14, WireType.Varint).int64(message.computeMs);
        /* int64 queue_wait_ms = 15; */
        if (message.queueWaitMs !== "0")
            writer.tag(15, WireType.Varint).int64(message.queueWaitMs);
        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.UsageStatRecord
 */
export const UsageStatRecord = new UsageStatRecord$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListUsageStatsResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListUsageStatsResponse", [
            { no: 1, name: "records", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UsageStatRecord },
            { no: 2, name: "next_page_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.records = [];
        message.nextPageToken = "";
        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.UsageStatRecord records */ 1:
                    message.records.push(UsageStatRecord.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* string next_page_token */ 2:
                    message.nextPageToken = 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) {
        /* repeated nimi.runtime.v1.UsageStatRecord records = 1; */
        for (let i = 0; i < message.records.length; i++)
            UsageStatRecord.internalBinaryWrite(message.records[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* string next_page_token = 2; */
        if (message.nextPageToken !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.nextPageToken);
        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.ListUsageStatsResponse
 */
export const ListUsageStatsResponse = new ListUsageStatsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRuntimeHealthRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.GetRuntimeHealthRequest", []);
    }
    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.GetRuntimeHealthRequest
 */
export const GetRuntimeHealthRequest = new GetRuntimeHealthRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRuntimeHealthResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.GetRuntimeHealthResponse", [
            { no: 1, name: "status", kind: "enum", T: () => ["nimi.runtime.v1.RuntimeHealthStatus", RuntimeHealthStatus, "RUNTIME_HEALTH_STATUS_"] },
            { no: 2, name: "reason", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "queue_depth", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 4, name: "active_workflows", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 5, name: "active_inference_jobs", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 6, name: "cpu_milli", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 7, name: "memory_bytes", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 8, name: "vram_bytes", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 9, name: "sampled_at", kind: "message", T: () => Timestamp }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.status = 0;
        message.reason = "";
        message.queueDepth = 0;
        message.activeWorkflows = 0;
        message.activeInferenceJobs = 0;
        message.cpuMilli = "0";
        message.memoryBytes = "0";
        message.vramBytes = "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 /* nimi.runtime.v1.RuntimeHealthStatus status */ 1:
                    message.status = reader.int32();
                    break;
                case /* string reason */ 2:
                    message.reason = reader.string();
                    break;
                case /* int32 queue_depth */ 3:
                    message.queueDepth = reader.int32();
                    break;
                case /* int32 active_workflows */ 4:
                    message.activeWorkflows = reader.int32();
                    break;
                case /* int32 active_inference_jobs */ 5:
                    message.activeInferenceJobs = reader.int32();
                    break;
                case /* int64 cpu_milli */ 6:
                    message.cpuMilli = reader.int64().toString();
                    break;
                case /* int64 memory_bytes */ 7:
                    message.memoryBytes = reader.int64().toString();
                    break;
                case /* int64 vram_bytes */ 8:
                    message.vramBytes = reader.int64().toString();
                    break;
                case /* google.protobuf.Timestamp sampled_at */ 9:
                    message.sampledAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.sampledAt);
                    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) {
        /* nimi.runtime.v1.RuntimeHealthStatus status = 1; */
        if (message.status !== 0)
            writer.tag(1, WireType.Varint).int32(message.status);
        /* string reason = 2; */
        if (message.reason !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.reason);
        /* int32 queue_depth = 3; */
        if (message.queueDepth !== 0)
            writer.tag(3, WireType.Varint).int32(message.queueDepth);
        /* int32 active_workflows = 4; */
        if (message.activeWorkflows !== 0)
            writer.tag(4, WireType.Varint).int32(message.activeWorkflows);
        /* int32 active_inference_jobs = 5; */
        if (message.activeInferenceJobs !== 0)
            writer.tag(5, WireType.Varint).int32(message.activeInferenceJobs);
        /* int64 cpu_milli = 6; */
        if (message.cpuMilli !== "0")
            writer.tag(6, WireType.Varint).int64(message.cpuMilli);
        /* int64 memory_bytes = 7; */
        if (message.memoryBytes !== "0")
            writer.tag(7, WireType.Varint).int64(message.memoryBytes);
        /* int64 vram_bytes = 8; */
        if (message.vramBytes !== "0")
            writer.tag(8, WireType.Varint).int64(message.vramBytes);
        /* google.protobuf.Timestamp sampled_at = 9; */
        if (message.sampledAt)
            Timestamp.internalBinaryWrite(message.sampledAt, writer.tag(9, 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.GetRuntimeHealthResponse
 */
export const GetRuntimeHealthResponse = new GetRuntimeHealthResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SubscribeRuntimeHealthEventsRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.SubscribeRuntimeHealthEventsRequest", []);
    }
    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.SubscribeRuntimeHealthEventsRequest
 */
export const SubscribeRuntimeHealthEventsRequest = new SubscribeRuntimeHealthEventsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RuntimeHealthEvent$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.RuntimeHealthEvent", [
            { no: 1, name: "sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
            { no: 2, name: "status", kind: "enum", T: () => ["nimi.runtime.v1.RuntimeHealthStatus", RuntimeHealthStatus, "RUNTIME_HEALTH_STATUS_"] },
            { no: 3, name: "reason", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "queue_depth", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 5, name: "active_workflows", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 6, name: "active_inference_jobs", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 7, name: "cpu_milli", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 8, name: "memory_bytes", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 9, name: "vram_bytes", kind: "scalar", T: 3 /*ScalarType.INT64*/ },
            { no: 10, name: "sampled_at", kind: "message", T: () => Timestamp }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.sequence = "0";
        message.status = 0;
        message.reason = "";
        message.queueDepth = 0;
        message.activeWorkflows = 0;
        message.activeInferenceJobs = 0;
        message.cpuMilli = "0";
        message.memoryBytes = "0";
        message.vramBytes = "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 /* uint64 sequence */ 1:
                    message.sequence = reader.uint64().toString();
                    break;
                case /* nimi.runtime.v1.RuntimeHealthStatus status */ 2:
                    message.status = reader.int32();
                    break;
                case /* string reason */ 3:
                    message.reason = reader.string();
                    break;
                case /* int32 queue_depth */ 4:
                    message.queueDepth = reader.int32();
                    break;
                case /* int32 active_workflows */ 5:
                    message.activeWorkflows = reader.int32();
                    break;
                case /* int32 active_inference_jobs */ 6:
                    message.activeInferenceJobs = reader.int32();
                    break;
                case /* int64 cpu_milli */ 7:
                    message.cpuMilli = reader.int64().toString();
                    break;
                case /* int64 memory_bytes */ 8:
                    message.memoryBytes = reader.int64().toString();
                    break;
                case /* int64 vram_bytes */ 9:
                    message.vramBytes = reader.int64().toString();
                    break;
                case /* google.protobuf.Timestamp sampled_at */ 10:
                    message.sampledAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.sampledAt);
                    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) {
        /* uint64 sequence = 1; */
        if (message.sequence !== "0")
            writer.tag(1, WireType.Varint).uint64(message.sequence);
        /* nimi.runtime.v1.RuntimeHealthStatus status = 2; */
        if (message.status !== 0)
            writer.tag(2, WireType.Varint).int32(message.status);
        /* string reason = 3; */
        if (message.reason !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.reason);
        /* int32 queue_depth = 4; */
        if (message.queueDepth !== 0)
            writer.tag(4, WireType.Varint).int32(message.queueDepth);
        /* int32 active_workflows = 5; */
        if (message.activeWorkflows !== 0)
            writer.tag(5, WireType.Varint).int32(message.activeWorkflows);
        /* int32 active_inference_jobs = 6; */
        if (message.activeInferenceJobs !== 0)
            writer.tag(6, WireType.Varint).int32(message.activeInferenceJobs);
        /* int64 cpu_milli = 7; */
        if (message.cpuMilli !== "0")
            writer.tag(7, WireType.Varint).int64(message.cpuMilli);
        /* int64 memory_bytes = 8; */
        if (message.memoryBytes !== "0")
            writer.tag(8, WireType.Varint).int64(message.memoryBytes);
        /* int64 vram_bytes = 9; */
        if (message.vramBytes !== "0")
            writer.tag(9, WireType.Varint).int64(message.vramBytes);
        /* google.protobuf.Timestamp sampled_at = 10; */
        if (message.sampledAt)
            Timestamp.internalBinaryWrite(message.sampledAt, writer.tag(10, 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.RuntimeHealthEvent
 */
export const RuntimeHealthEvent = new RuntimeHealthEvent$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListAIProviderHealthRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListAIProviderHealthRequest", []);
    }
    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.ListAIProviderHealthRequest
 */
export const ListAIProviderHealthRequest = new ListAIProviderHealthRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AIProviderSubHealth$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.AIProviderSubHealth", [
            { no: 1, name: "provider_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "state", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "reason", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "consecutive_failures", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 5, name: "last_changed_at", kind: "message", T: () => Timestamp },
            { no: 6, name: "last_checked_at", kind: "message", T: () => Timestamp }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.providerName = "";
        message.state = "";
        message.reason = "";
        message.consecutiveFailures = 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 provider_name */ 1:
                    message.providerName = reader.string();
                    break;
                case /* string state */ 2:
                    message.state = reader.string();
                    break;
                case /* string reason */ 3:
                    message.reason = reader.string();
                    break;
                case /* int32 consecutive_failures */ 4:
                    message.consecutiveFailures = reader.int32();
                    break;
                case /* google.protobuf.Timestamp last_changed_at */ 5:
                    message.lastChangedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastChangedAt);
                    break;
                case /* google.protobuf.Timestamp last_checked_at */ 6:
                    message.lastCheckedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastCheckedAt);
                    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 provider_name = 1; */
        if (message.providerName !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.providerName);
        /* string state = 2; */
        if (message.state !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.state);
        /* string reason = 3; */
        if (message.reason !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.reason);
        /* int32 consecutive_failures = 4; */
        if (message.consecutiveFailures !== 0)
            writer.tag(4, WireType.Varint).int32(message.consecutiveFailures);
        /* google.protobuf.Timestamp last_changed_at = 5; */
        if (message.lastChangedAt)
            Timestamp.internalBinaryWrite(message.lastChangedAt, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.Timestamp last_checked_at = 6; */
        if (message.lastCheckedAt)
            Timestamp.internalBinaryWrite(message.lastCheckedAt, writer.tag(6, 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.AIProviderSubHealth
 */
export const AIProviderSubHealth = new AIProviderSubHealth$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AIProviderHealthSnapshot$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.AIProviderHealthSnapshot", [
            { no: 1, name: "provider_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "state", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "reason", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "consecutive_failures", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 5, name: "last_changed_at", kind: "message", T: () => Timestamp },
            { no: 6, name: "last_checked_at", kind: "message", T: () => Timestamp },
            { no: 7, name: "sub_health", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => AIProviderSubHealth }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.providerName = "";
        message.state = "";
        message.reason = "";
        message.consecutiveFailures = 0;
        message.subHealth = [];
        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 provider_name */ 1:
                    message.providerName = reader.string();
                    break;
                case /* string state */ 2:
                    message.state = reader.string();
                    break;
                case /* string reason */ 3:
                    message.reason = reader.string();
                    break;
                case /* int32 consecutive_failures */ 4:
                    message.consecutiveFailures = reader.int32();
                    break;
                case /* google.protobuf.Timestamp last_changed_at */ 5:
                    message.lastChangedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastChangedAt);
                    break;
                case /* google.protobuf.Timestamp last_checked_at */ 6:
                    message.lastCheckedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastCheckedAt);
                    break;
                case /* repeated nimi.runtime.v1.AIProviderSubHealth sub_health */ 7:
                    message.subHealth.push(AIProviderSubHealth.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) {
        /* string provider_name = 1; */
        if (message.providerName !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.providerName);
        /* string state = 2; */
        if (message.state !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.state);
        /* string reason = 3; */
        if (message.reason !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.reason);
        /* int32 consecutive_failures = 4; */
        if (message.consecutiveFailures !== 0)
            writer.tag(4, WireType.Varint).int32(message.consecutiveFailures);
        /* google.protobuf.Timestamp last_changed_at = 5; */
        if (message.lastChangedAt)
            Timestamp.internalBinaryWrite(message.lastChangedAt, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.Timestamp last_checked_at = 6; */
        if (message.lastCheckedAt)
            Timestamp.internalBinaryWrite(message.lastCheckedAt, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* repeated nimi.runtime.v1.AIProviderSubHealth sub_health = 7; */
        for (let i = 0; i < message.subHealth.length; i++)
            AIProviderSubHealth.internalBinaryWrite(message.subHealth[i], writer.tag(7, 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.AIProviderHealthSnapshot
 */
export const AIProviderHealthSnapshot = new AIProviderHealthSnapshot$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListAIProviderHealthResponse$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.ListAIProviderHealthResponse", [
            { no: 1, name: "providers", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => AIProviderHealthSnapshot }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.providers = [];
        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.AIProviderHealthSnapshot providers */ 1:
                    message.providers.push(AIProviderHealthSnapshot.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.AIProviderHealthSnapshot providers = 1; */
        for (let i = 0; i < message.providers.length; i++)
            AIProviderHealthSnapshot.internalBinaryWrite(message.providers[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.ListAIProviderHealthResponse
 */
export const ListAIProviderHealthResponse = new ListAIProviderHealthResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class SubscribeAIProviderHealthEventsRequest$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.SubscribeAIProviderHealthEventsRequest", []);
    }
    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.SubscribeAIProviderHealthEventsRequest
 */
export const SubscribeAIProviderHealthEventsRequest = new SubscribeAIProviderHealthEventsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AIProviderHealthEvent$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.AIProviderHealthEvent", [
            { no: 1, name: "sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
            { no: 2, name: "provider_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "state", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "reason", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "consecutive_failures", kind: "scalar", T: 5 /*ScalarType.INT32*/ },
            { no: 6, name: "last_changed_at", kind: "message", T: () => Timestamp },
            { no: 7, name: "last_checked_at", kind: "message", T: () => Timestamp },
            { no: 8, name: "sub_health", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => AIProviderSubHealth }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.sequence = "0";
        message.providerName = "";
        message.state = "";
        message.reason = "";
        message.consecutiveFailures = 0;
        message.subHealth = [];
        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 /* uint64 sequence */ 1:
                    message.sequence = reader.uint64().toString();
                    break;
                case /* string provider_name */ 2:
                    message.providerName = reader.string();
                    break;
                case /* string state */ 3:
                    message.state = reader.string();
                    break;
                case /* string reason */ 4:
                    message.reason = reader.string();
                    break;
                case /* int32 consecutive_failures */ 5:
                    message.consecutiveFailures = reader.int32();
                    break;
                case /* google.protobuf.Timestamp last_changed_at */ 6:
                    message.lastChangedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastChangedAt);
                    break;
                case /* google.protobuf.Timestamp last_checked_at */ 7:
                    message.lastCheckedAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lastCheckedAt);
                    break;
                case /* repeated nimi.runtime.v1.AIProviderSubHealth sub_health */ 8:
                    message.subHealth.push(AIProviderSubHealth.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) {
        /* uint64 sequence = 1; */
        if (message.sequence !== "0")
            writer.tag(1, WireType.Varint).uint64(message.sequence);
        /* string provider_name = 2; */
        if (message.providerName !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.providerName);
        /* string state = 3; */
        if (message.state !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.state);
        /* string reason = 4; */
        if (message.reason !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.reason);
        /* int32 consecutive_failures = 5; */
        if (message.consecutiveFailures !== 0)
            writer.tag(5, WireType.Varint).int32(message.consecutiveFailures);
        /* google.protobuf.Timestamp last_changed_at = 6; */
        if (message.lastChangedAt)
            Timestamp.internalBinaryWrite(message.lastChangedAt, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* google.protobuf.Timestamp last_checked_at = 7; */
        if (message.lastCheckedAt)
            Timestamp.internalBinaryWrite(message.lastCheckedAt, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* repeated nimi.runtime.v1.AIProviderSubHealth sub_health = 8; */
        for (let i = 0; i < message.subHealth.length; i++)
            AIProviderSubHealth.internalBinaryWrite(message.subHealth[i], writer.tag(8, 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.AIProviderHealthEvent
 */
export const AIProviderHealthEvent = new AIProviderHealthEvent$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AuditExportChunk$Type extends MessageType {
    constructor() {
        super("nimi.runtime.v1.AuditExportChunk", [
            { no: 1, name: "export_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "sequence", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
            { no: 3, name: "chunk", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
            { no: 4, name: "eof", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
            { no: 5, name: "mime_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value) {
        const message = globalThis.Object.create((this.messagePrototype));
        message.exportId = "";
        message.sequence = "0";
        message.chunk = new Uint8Array(0);
        message.eof = false;
        message.mimeType = "";
        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 export_id */ 1:
                    message.exportId = reader.string();
                    break;
                case /* uint64 sequence */ 2:
                    message.sequence = reader.uint64().toString();
                    break;
                case /* bytes chunk */ 3:
                    message.chunk = reader.bytes();
                    break;
                case /* bool eof */ 4:
                    message.eof = reader.bool();
                    break;
                case /* string mime_type */ 5:
                    message.mimeType = 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 export_id = 1; */
        if (message.exportId !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.exportId);
        /* uint64 sequence = 2; */
        if (message.sequence !== "0")
            writer.tag(2, WireType.Varint).uint64(message.sequence);
        /* bytes chunk = 3; */
        if (message.chunk.length)
            writer.tag(3, WireType.LengthDelimited).bytes(message.chunk);
        /* bool eof = 4; */
        if (message.eof !== false)
            writer.tag(4, WireType.Varint).bool(message.eof);
        /* string mime_type = 5; */
        if (message.mimeType !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.mimeType);
        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.AuditExportChunk
 */
export const AuditExportChunk = new AuditExportChunk$Type();
/**
 * @generated ServiceType for protobuf service nimi.runtime.v1.RuntimeAuditService
 */
export const RuntimeAuditService = new ServiceType("nimi.runtime.v1.RuntimeAuditService", [
    { name: "ListAuditEvents", options: {}, I: ListAuditEventsRequest, O: ListAuditEventsResponse },
    { name: "ExportAuditEvents", serverStreaming: true, options: {}, I: ExportAuditEventsRequest, O: AuditExportChunk },
    { name: "ListUsageStats", options: {}, I: ListUsageStatsRequest, O: ListUsageStatsResponse },
    { name: "GetRuntimeHealth", options: {}, I: GetRuntimeHealthRequest, O: GetRuntimeHealthResponse },
    { name: "ListAIProviderHealth", options: {}, I: ListAIProviderHealthRequest, O: ListAIProviderHealthResponse },
    { name: "SubscribeAIProviderHealthEvents", serverStreaming: true, options: {}, I: SubscribeAIProviderHealthEventsRequest, O: AIProviderHealthEvent },
    { name: "SubscribeRuntimeHealthEvents", serverStreaming: true, options: {}, I: SubscribeRuntimeHealthEventsRequest, O: RuntimeHealthEvent }
]);
//# sourceMappingURL=audit.js.map