// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
//   protoc-gen-ts_proto  v2.11.5
//   protoc               v7.34.1
// source: WshEventDataRequest.proto

/* eslint-disable */
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";

export const protobufPackage = "protobuf";

export interface WshEventDataRequest {
  reqId?: number | undefined;
  conId?: number | undefined;
  filter?: string | undefined;
  fillWatchlist?: boolean | undefined;
  fillPortfolio?: boolean | undefined;
  fillCompetitors?: boolean | undefined;
  startDate?: string | undefined;
  endDate?: string | undefined;
  totalLimit?: number | undefined;
}

function createBaseWshEventDataRequest(): WshEventDataRequest {
  return {
    reqId: undefined,
    conId: undefined,
    filter: undefined,
    fillWatchlist: undefined,
    fillPortfolio: undefined,
    fillCompetitors: undefined,
    startDate: undefined,
    endDate: undefined,
    totalLimit: undefined,
  };
}

export const WshEventDataRequest: MessageFns<WshEventDataRequest> = {
  encode(message: WshEventDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
    if (message.reqId !== undefined) {
      writer.uint32(8).int32(message.reqId);
    }
    if (message.conId !== undefined) {
      writer.uint32(16).int32(message.conId);
    }
    if (message.filter !== undefined) {
      writer.uint32(26).string(message.filter);
    }
    if (message.fillWatchlist !== undefined) {
      writer.uint32(32).bool(message.fillWatchlist);
    }
    if (message.fillPortfolio !== undefined) {
      writer.uint32(40).bool(message.fillPortfolio);
    }
    if (message.fillCompetitors !== undefined) {
      writer.uint32(48).bool(message.fillCompetitors);
    }
    if (message.startDate !== undefined) {
      writer.uint32(58).string(message.startDate);
    }
    if (message.endDate !== undefined) {
      writer.uint32(66).string(message.endDate);
    }
    if (message.totalLimit !== undefined) {
      writer.uint32(72).int32(message.totalLimit);
    }
    return writer;
  },

  decode(input: BinaryReader | Uint8Array, length?: number): WshEventDataRequest {
    const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
    const end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseWshEventDataRequest();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1: {
          if (tag !== 8) {
            break;
          }

          message.reqId = reader.int32();
          continue;
        }
        case 2: {
          if (tag !== 16) {
            break;
          }

          message.conId = reader.int32();
          continue;
        }
        case 3: {
          if (tag !== 26) {
            break;
          }

          message.filter = reader.string();
          continue;
        }
        case 4: {
          if (tag !== 32) {
            break;
          }

          message.fillWatchlist = reader.bool();
          continue;
        }
        case 5: {
          if (tag !== 40) {
            break;
          }

          message.fillPortfolio = reader.bool();
          continue;
        }
        case 6: {
          if (tag !== 48) {
            break;
          }

          message.fillCompetitors = reader.bool();
          continue;
        }
        case 7: {
          if (tag !== 58) {
            break;
          }

          message.startDate = reader.string();
          continue;
        }
        case 8: {
          if (tag !== 66) {
            break;
          }

          message.endDate = reader.string();
          continue;
        }
        case 9: {
          if (tag !== 72) {
            break;
          }

          message.totalLimit = reader.int32();
          continue;
        }
      }
      if ((tag & 7) === 4 || tag === 0) {
        break;
      }
      reader.skip(tag & 7);
    }
    return message;
  },

  fromJSON(object: any): WshEventDataRequest {
    return {
      reqId: isSet(object.reqId) ? globalThis.Number(object.reqId) : undefined,
      conId: isSet(object.conId) ? globalThis.Number(object.conId) : undefined,
      filter: isSet(object.filter) ? globalThis.String(object.filter) : undefined,
      fillWatchlist: isSet(object.fillWatchlist) ? globalThis.Boolean(object.fillWatchlist) : undefined,
      fillPortfolio: isSet(object.fillPortfolio) ? globalThis.Boolean(object.fillPortfolio) : undefined,
      fillCompetitors: isSet(object.fillCompetitors) ? globalThis.Boolean(object.fillCompetitors) : undefined,
      startDate: isSet(object.startDate) ? globalThis.String(object.startDate) : undefined,
      endDate: isSet(object.endDate) ? globalThis.String(object.endDate) : undefined,
      totalLimit: isSet(object.totalLimit) ? globalThis.Number(object.totalLimit) : undefined,
    };
  },

  toJSON(message: WshEventDataRequest): unknown {
    const obj: any = {};
    if (message.reqId !== undefined) {
      obj.reqId = Math.round(message.reqId);
    }
    if (message.conId !== undefined) {
      obj.conId = Math.round(message.conId);
    }
    if (message.filter !== undefined) {
      obj.filter = message.filter;
    }
    if (message.fillWatchlist !== undefined) {
      obj.fillWatchlist = message.fillWatchlist;
    }
    if (message.fillPortfolio !== undefined) {
      obj.fillPortfolio = message.fillPortfolio;
    }
    if (message.fillCompetitors !== undefined) {
      obj.fillCompetitors = message.fillCompetitors;
    }
    if (message.startDate !== undefined) {
      obj.startDate = message.startDate;
    }
    if (message.endDate !== undefined) {
      obj.endDate = message.endDate;
    }
    if (message.totalLimit !== undefined) {
      obj.totalLimit = Math.round(message.totalLimit);
    }
    return obj;
  },

  create(base?: DeepPartial<WshEventDataRequest>): WshEventDataRequest {
    return WshEventDataRequest.fromPartial(base ?? {});
  },
  fromPartial(object: DeepPartial<WshEventDataRequest>): WshEventDataRequest {
    const message = createBaseWshEventDataRequest();
    message.reqId = object.reqId ?? undefined;
    message.conId = object.conId ?? undefined;
    message.filter = object.filter ?? undefined;
    message.fillWatchlist = object.fillWatchlist ?? undefined;
    message.fillPortfolio = object.fillPortfolio ?? undefined;
    message.fillCompetitors = object.fillCompetitors ?? undefined;
    message.startDate = object.startDate ?? undefined;
    message.endDate = object.endDate ?? undefined;
    message.totalLimit = object.totalLimit ?? undefined;
    return message;
  },
};

type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;

export type DeepPartial<T> = T extends Builtin ? T
  : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
  : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
  : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
  : Partial<T>;

function isSet(value: any): boolean {
  return value !== null && value !== undefined;
}

export interface MessageFns<T> {
  encode(message: T, writer?: BinaryWriter): BinaryWriter;
  decode(input: BinaryReader | Uint8Array, length?: number): T;
  fromJSON(object: any): T;
  toJSON(message: T): unknown;
  create(base?: DeepPartial<T>): T;
  fromPartial(object: DeepPartial<T>): T;
}
