// automatically generated by the FlatBuffers compiler, do not modify

/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */

import * as flatbuffers from 'flatbuffers';



export class ApplicationSummary implements flatbuffers.IUnpackableObject<ApplicationSummaryT> {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):ApplicationSummary {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

static getRootAsApplicationSummary(bb:flatbuffers.ByteBuffer, obj?:ApplicationSummary):ApplicationSummary {
  return (obj || new ApplicationSummary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

static getSizePrefixedRootAsApplicationSummary(bb:flatbuffers.ByteBuffer, obj?:ApplicationSummary):ApplicationSummary {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new ApplicationSummary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
}

applicationId():string|null
applicationId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
applicationId(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

gameId():string|null
gameId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
gameId(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 6);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

applicantUserId():string|null
applicantUserId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
applicantUserId(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 8);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

raceName():string|null
raceName(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
raceName(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 10);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

status():string|null
status(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
status(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 12);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

createdAtMs():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 14);
  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}

decidedAtMs():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 16);
  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}

static startApplicationSummary(builder:flatbuffers.Builder) {
  builder.startObject(7);
}

static addApplicationId(builder:flatbuffers.Builder, applicationIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, applicationIdOffset, 0);
}

static addGameId(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(1, gameIdOffset, 0);
}

static addApplicantUserId(builder:flatbuffers.Builder, applicantUserIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(2, applicantUserIdOffset, 0);
}

static addRaceName(builder:flatbuffers.Builder, raceNameOffset:flatbuffers.Offset) {
  builder.addFieldOffset(3, raceNameOffset, 0);
}

static addStatus(builder:flatbuffers.Builder, statusOffset:flatbuffers.Offset) {
  builder.addFieldOffset(4, statusOffset, 0);
}

static addCreatedAtMs(builder:flatbuffers.Builder, createdAtMs:bigint) {
  builder.addFieldInt64(5, createdAtMs, BigInt('0'));
}

static addDecidedAtMs(builder:flatbuffers.Builder, decidedAtMs:bigint) {
  builder.addFieldInt64(6, decidedAtMs, BigInt('0'));
}

static endApplicationSummary(builder:flatbuffers.Builder):flatbuffers.Offset {
  const offset = builder.endObject();
  return offset;
}

static createApplicationSummary(builder:flatbuffers.Builder, applicationIdOffset:flatbuffers.Offset, gameIdOffset:flatbuffers.Offset, applicantUserIdOffset:flatbuffers.Offset, raceNameOffset:flatbuffers.Offset, statusOffset:flatbuffers.Offset, createdAtMs:bigint, decidedAtMs:bigint):flatbuffers.Offset {
  ApplicationSummary.startApplicationSummary(builder);
  ApplicationSummary.addApplicationId(builder, applicationIdOffset);
  ApplicationSummary.addGameId(builder, gameIdOffset);
  ApplicationSummary.addApplicantUserId(builder, applicantUserIdOffset);
  ApplicationSummary.addRaceName(builder, raceNameOffset);
  ApplicationSummary.addStatus(builder, statusOffset);
  ApplicationSummary.addCreatedAtMs(builder, createdAtMs);
  ApplicationSummary.addDecidedAtMs(builder, decidedAtMs);
  return ApplicationSummary.endApplicationSummary(builder);
}

unpack(): ApplicationSummaryT {
  return new ApplicationSummaryT(
    this.applicationId(),
    this.gameId(),
    this.applicantUserId(),
    this.raceName(),
    this.status(),
    this.createdAtMs(),
    this.decidedAtMs()
  );
}


unpackTo(_o: ApplicationSummaryT): void {
  _o.applicationId = this.applicationId();
  _o.gameId = this.gameId();
  _o.applicantUserId = this.applicantUserId();
  _o.raceName = this.raceName();
  _o.status = this.status();
  _o.createdAtMs = this.createdAtMs();
  _o.decidedAtMs = this.decidedAtMs();
}
}

export class ApplicationSummaryT implements flatbuffers.IGeneratedObject {
constructor(
  public applicationId: string|Uint8Array|null = null,
  public gameId: string|Uint8Array|null = null,
  public applicantUserId: string|Uint8Array|null = null,
  public raceName: string|Uint8Array|null = null,
  public status: string|Uint8Array|null = null,
  public createdAtMs: bigint = BigInt('0'),
  public decidedAtMs: bigint = BigInt('0')
){}


pack(builder:flatbuffers.Builder): flatbuffers.Offset {
  const applicationId = (this.applicationId !== null ? builder.createString(this.applicationId!) : 0);
  const gameId = (this.gameId !== null ? builder.createString(this.gameId!) : 0);
  const applicantUserId = (this.applicantUserId !== null ? builder.createString(this.applicantUserId!) : 0);
  const raceName = (this.raceName !== null ? builder.createString(this.raceName!) : 0);
  const status = (this.status !== null ? builder.createString(this.status!) : 0);

  return ApplicationSummary.createApplicationSummary(builder,
    applicationId,
    gameId,
    applicantUserId,
    raceName,
    status,
    this.createdAtMs,
    this.decidedAtMs
  );
}
}
