// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "tradeClickhouseStatement.proto" (package "api", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { Actor } from "./actor";
import { Item } from "./item";
import { Movement } from "./movement";
import { Handlingunit } from "./handlingunit";
import { Stock } from "./stock";
import { Executionflow } from "./executionflow";
import { MetadatasToApply } from "./metadata";
/**
 * ClickHouseInput Proto message for clickhouse streaming process
 *
 * @generated from protobuf message api.TradeClickHouseInput
 */
export interface TradeClickHouseInput {
    /**
     * @generated from protobuf field: api.TradeClickhouseElements ClickhouseElements = 1 [json_name = "ClickhouseElements"];
     */
    clickhouseElements?: TradeClickhouseElements;
    /**
     * @generated from protobuf field: repeated api.MetadatasToApply MetadatasToApply = 2 [json_name = "MetadatasToApply"];
     */
    metadatasToApply: MetadatasToApply[];
}
/**
 * @generated from protobuf message api.TradeClickhouseElement
 */
export interface TradeClickhouseElement {
    /**
     * @generated from protobuf oneof: Content
     */
    content: {
        oneofKind: "executionflow";
        /**
         * @generated from protobuf field: api.Executionflow Executionflow = 1 [json_name = "Executionflow"];
         */
        executionflow: Executionflow;
    } | {
        oneofKind: "stock";
        /**
         * @generated from protobuf field: api.Stock Stock = 2 [json_name = "Stock"];
         */
        stock: Stock;
    } | {
        oneofKind: "handlingunit";
        /**
         * @generated from protobuf field: api.Handlingunit Handlingunit = 3 [json_name = "Handlingunit"];
         */
        handlingunit: Handlingunit;
    } | {
        oneofKind: "movement";
        /**
         * @generated from protobuf field: api.Movement Movement = 4 [json_name = "Movement"];
         */
        movement: Movement;
    } | {
        oneofKind: "item";
        /**
         * @generated from protobuf field: api.Item Item = 5 [json_name = "Item"];
         */
        item: Item;
    } | {
        oneofKind: "actor";
        /**
         * @generated from protobuf field: api.Actor Actor = 6 [json_name = "Actor"];
         */
        actor: Actor;
    } | {
        oneofKind: undefined;
    };
}
/**
 * @generated from protobuf message api.TradeClickhouseElements
 */
export interface TradeClickhouseElements {
    /**
     * @generated from protobuf field: repeated api.TradeClickhouseElement ClickhouseElements = 1 [json_name = "ClickhouseElements"];
     */
    clickhouseElements: TradeClickhouseElement[];
}
/**
 * TradeCheckpointData  Proto message for clickhouse streaming process
 *
 * @generated from protobuf message api.TradeCheckpointData
 */
export interface TradeCheckpointData {
    /**
     * @generated from protobuf field: int64 IdCheckpoint = 1 [json_name = "IdCheckpoint"];
     */
    idCheckpoint: bigint;
    /**
     * @generated from protobuf field: string Project = 2 [json_name = "Project"];
     */
    project: string;
    /**
     * @generated from protobuf field: repeated api.TradeClickHouseInput ClickHouseInput = 3 [json_name = "ClickHouseInput"];
     */
    clickHouseInput: TradeClickHouseInput[];
}
// @generated message type with reflection information, may provide speed optimized methods
class TradeClickHouseInput$Type extends MessageType<TradeClickHouseInput> {
    constructor() {
        super("api.TradeClickHouseInput", [
            { no: 1, name: "ClickhouseElements", kind: "message", jsonName: "ClickhouseElements", T: () => TradeClickhouseElements },
            { no: 2, name: "MetadatasToApply", kind: "message", jsonName: "MetadatasToApply", repeat: 1 /*RepeatType.PACKED*/, T: () => MetadatasToApply }
        ]);
    }
    create(value?: PartialMessage<TradeClickHouseInput>): TradeClickHouseInput {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.metadatasToApply = [];
        if (value !== undefined)
            reflectionMergePartial<TradeClickHouseInput>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TradeClickHouseInput): TradeClickHouseInput {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.TradeClickhouseElements ClickhouseElements = 1 [json_name = "ClickhouseElements"];*/ 1:
                    message.clickhouseElements = TradeClickhouseElements.internalBinaryRead(reader, reader.uint32(), options, message.clickhouseElements);
                    break;
                case /* repeated api.MetadatasToApply MetadatasToApply = 2 [json_name = "MetadatasToApply"];*/ 2:
                    message.metadatasToApply.push(MetadatasToApply.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: TradeClickHouseInput, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.TradeClickhouseElements ClickhouseElements = 1 [json_name = "ClickhouseElements"]; */
        if (message.clickhouseElements)
            TradeClickhouseElements.internalBinaryWrite(message.clickhouseElements, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.MetadatasToApply MetadatasToApply = 2 [json_name = "MetadatasToApply"]; */
        for (let i = 0; i < message.metadatasToApply.length; i++)
            MetadatasToApply.internalBinaryWrite(message.metadatasToApply[i], writer.tag(2, 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 api.TradeClickHouseInput
 */
export const TradeClickHouseInput = new TradeClickHouseInput$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TradeClickhouseElement$Type extends MessageType<TradeClickhouseElement> {
    constructor() {
        super("api.TradeClickhouseElement", [
            { no: 1, name: "Executionflow", kind: "message", jsonName: "Executionflow", oneof: "content", T: () => Executionflow },
            { no: 2, name: "Stock", kind: "message", jsonName: "Stock", oneof: "content", T: () => Stock },
            { no: 3, name: "Handlingunit", kind: "message", jsonName: "Handlingunit", oneof: "content", T: () => Handlingunit },
            { no: 4, name: "Movement", kind: "message", jsonName: "Movement", oneof: "content", T: () => Movement },
            { no: 5, name: "Item", kind: "message", jsonName: "Item", oneof: "content", T: () => Item },
            { no: 6, name: "Actor", kind: "message", jsonName: "Actor", oneof: "content", T: () => Actor }
        ]);
    }
    create(value?: PartialMessage<TradeClickhouseElement>): TradeClickhouseElement {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.content = { oneofKind: undefined };
        if (value !== undefined)
            reflectionMergePartial<TradeClickhouseElement>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TradeClickhouseElement): TradeClickhouseElement {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Executionflow Executionflow = 1 [json_name = "Executionflow"];*/ 1:
                    message.content = {
                        oneofKind: "executionflow",
                        executionflow: Executionflow.internalBinaryRead(reader, reader.uint32(), options, (message.content as any).executionflow)
                    };
                    break;
                case /* api.Stock Stock = 2 [json_name = "Stock"];*/ 2:
                    message.content = {
                        oneofKind: "stock",
                        stock: Stock.internalBinaryRead(reader, reader.uint32(), options, (message.content as any).stock)
                    };
                    break;
                case /* api.Handlingunit Handlingunit = 3 [json_name = "Handlingunit"];*/ 3:
                    message.content = {
                        oneofKind: "handlingunit",
                        handlingunit: Handlingunit.internalBinaryRead(reader, reader.uint32(), options, (message.content as any).handlingunit)
                    };
                    break;
                case /* api.Movement Movement = 4 [json_name = "Movement"];*/ 4:
                    message.content = {
                        oneofKind: "movement",
                        movement: Movement.internalBinaryRead(reader, reader.uint32(), options, (message.content as any).movement)
                    };
                    break;
                case /* api.Item Item = 5 [json_name = "Item"];*/ 5:
                    message.content = {
                        oneofKind: "item",
                        item: Item.internalBinaryRead(reader, reader.uint32(), options, (message.content as any).item)
                    };
                    break;
                case /* api.Actor Actor = 6 [json_name = "Actor"];*/ 6:
                    message.content = {
                        oneofKind: "actor",
                        actor: Actor.internalBinaryRead(reader, reader.uint32(), options, (message.content as any).actor)
                    };
                    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: TradeClickhouseElement, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Executionflow Executionflow = 1 [json_name = "Executionflow"]; */
        if (message.content.oneofKind === "executionflow")
            Executionflow.internalBinaryWrite(message.content.executionflow, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.Stock Stock = 2 [json_name = "Stock"]; */
        if (message.content.oneofKind === "stock")
            Stock.internalBinaryWrite(message.content.stock, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* api.Handlingunit Handlingunit = 3 [json_name = "Handlingunit"]; */
        if (message.content.oneofKind === "handlingunit")
            Handlingunit.internalBinaryWrite(message.content.handlingunit, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* api.Movement Movement = 4 [json_name = "Movement"]; */
        if (message.content.oneofKind === "movement")
            Movement.internalBinaryWrite(message.content.movement, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.Item Item = 5 [json_name = "Item"]; */
        if (message.content.oneofKind === "item")
            Item.internalBinaryWrite(message.content.item, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* api.Actor Actor = 6 [json_name = "Actor"]; */
        if (message.content.oneofKind === "actor")
            Actor.internalBinaryWrite(message.content.actor, 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 api.TradeClickhouseElement
 */
export const TradeClickhouseElement = new TradeClickhouseElement$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TradeClickhouseElements$Type extends MessageType<TradeClickhouseElements> {
    constructor() {
        super("api.TradeClickhouseElements", [
            { no: 1, name: "ClickhouseElements", kind: "message", jsonName: "ClickhouseElements", repeat: 1 /*RepeatType.PACKED*/, T: () => TradeClickhouseElement }
        ]);
    }
    create(value?: PartialMessage<TradeClickhouseElements>): TradeClickhouseElements {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.clickhouseElements = [];
        if (value !== undefined)
            reflectionMergePartial<TradeClickhouseElements>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TradeClickhouseElements): TradeClickhouseElements {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.TradeClickhouseElement ClickhouseElements = 1 [json_name = "ClickhouseElements"];*/ 1:
                    message.clickhouseElements.push(TradeClickhouseElement.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: TradeClickhouseElements, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.TradeClickhouseElement ClickhouseElements = 1 [json_name = "ClickhouseElements"]; */
        for (let i = 0; i < message.clickhouseElements.length; i++)
            TradeClickhouseElement.internalBinaryWrite(message.clickhouseElements[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 api.TradeClickhouseElements
 */
export const TradeClickhouseElements = new TradeClickhouseElements$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TradeCheckpointData$Type extends MessageType<TradeCheckpointData> {
    constructor() {
        super("api.TradeCheckpointData", [
            { no: 1, name: "IdCheckpoint", kind: "scalar", jsonName: "IdCheckpoint", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
            { no: 2, name: "Project", kind: "scalar", jsonName: "Project", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "ClickHouseInput", kind: "message", jsonName: "ClickHouseInput", repeat: 1 /*RepeatType.PACKED*/, T: () => TradeClickHouseInput }
        ]);
    }
    create(value?: PartialMessage<TradeCheckpointData>): TradeCheckpointData {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.idCheckpoint = 0n;
        message.project = "";
        message.clickHouseInput = [];
        if (value !== undefined)
            reflectionMergePartial<TradeCheckpointData>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TradeCheckpointData): TradeCheckpointData {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* int64 IdCheckpoint = 1 [json_name = "IdCheckpoint"];*/ 1:
                    message.idCheckpoint = reader.int64().toBigInt();
                    break;
                case /* string Project = 2 [json_name = "Project"];*/ 2:
                    message.project = reader.string();
                    break;
                case /* repeated api.TradeClickHouseInput ClickHouseInput = 3 [json_name = "ClickHouseInput"];*/ 3:
                    message.clickHouseInput.push(TradeClickHouseInput.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: TradeCheckpointData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* int64 IdCheckpoint = 1 [json_name = "IdCheckpoint"]; */
        if (message.idCheckpoint !== 0n)
            writer.tag(1, WireType.Varint).int64(message.idCheckpoint);
        /* string Project = 2 [json_name = "Project"]; */
        if (message.project !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.project);
        /* repeated api.TradeClickHouseInput ClickHouseInput = 3 [json_name = "ClickHouseInput"]; */
        for (let i = 0; i < message.clickHouseInput.length; i++)
            TradeClickHouseInput.internalBinaryWrite(message.clickHouseInput[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.TradeCheckpointData
 */
export const TradeCheckpointData = new TradeCheckpointData$Type();
