// 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 InviteSummary implements flatbuffers.IUnpackableObject<InviteSummaryT> {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):InviteSummary {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

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

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

inviteId():string|null
inviteId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
inviteId(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;
}

inviterUserId():string|null
inviterUserId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
inviterUserId(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;
}

invitedUserId():string|null
invitedUserId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
invitedUserId(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;
}

code():string|null
code(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
code(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;
}

raceName():string|null
raceName(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
raceName(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 14);
  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, 16);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

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

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

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

static startInviteSummary(builder:flatbuffers.Builder) {
  builder.startObject(10);
}

static addInviteId(builder:flatbuffers.Builder, inviteIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, inviteIdOffset, 0);
}

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

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

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

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

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

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

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

static addExpiresAtMs(builder:flatbuffers.Builder, expiresAtMs:bigint) {
  builder.addFieldInt64(8, expiresAtMs, BigInt('0'));
}

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

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

static createInviteSummary(builder:flatbuffers.Builder, inviteIdOffset:flatbuffers.Offset, gameIdOffset:flatbuffers.Offset, inviterUserIdOffset:flatbuffers.Offset, invitedUserIdOffset:flatbuffers.Offset, codeOffset:flatbuffers.Offset, raceNameOffset:flatbuffers.Offset, statusOffset:flatbuffers.Offset, createdAtMs:bigint, expiresAtMs:bigint, decidedAtMs:bigint):flatbuffers.Offset {
  InviteSummary.startInviteSummary(builder);
  InviteSummary.addInviteId(builder, inviteIdOffset);
  InviteSummary.addGameId(builder, gameIdOffset);
  InviteSummary.addInviterUserId(builder, inviterUserIdOffset);
  InviteSummary.addInvitedUserId(builder, invitedUserIdOffset);
  InviteSummary.addCode(builder, codeOffset);
  InviteSummary.addRaceName(builder, raceNameOffset);
  InviteSummary.addStatus(builder, statusOffset);
  InviteSummary.addCreatedAtMs(builder, createdAtMs);
  InviteSummary.addExpiresAtMs(builder, expiresAtMs);
  InviteSummary.addDecidedAtMs(builder, decidedAtMs);
  return InviteSummary.endInviteSummary(builder);
}

unpack(): InviteSummaryT {
  return new InviteSummaryT(
    this.inviteId(),
    this.gameId(),
    this.inviterUserId(),
    this.invitedUserId(),
    this.code(),
    this.raceName(),
    this.status(),
    this.createdAtMs(),
    this.expiresAtMs(),
    this.decidedAtMs()
  );
}


unpackTo(_o: InviteSummaryT): void {
  _o.inviteId = this.inviteId();
  _o.gameId = this.gameId();
  _o.inviterUserId = this.inviterUserId();
  _o.invitedUserId = this.invitedUserId();
  _o.code = this.code();
  _o.raceName = this.raceName();
  _o.status = this.status();
  _o.createdAtMs = this.createdAtMs();
  _o.expiresAtMs = this.expiresAtMs();
  _o.decidedAtMs = this.decidedAtMs();
}
}

export class InviteSummaryT implements flatbuffers.IGeneratedObject {
constructor(
  public inviteId: string|Uint8Array|null = null,
  public gameId: string|Uint8Array|null = null,
  public inviterUserId: string|Uint8Array|null = null,
  public invitedUserId: string|Uint8Array|null = null,
  public code: string|Uint8Array|null = null,
  public raceName: string|Uint8Array|null = null,
  public status: string|Uint8Array|null = null,
  public createdAtMs: bigint = BigInt('0'),
  public expiresAtMs: bigint = BigInt('0'),
  public decidedAtMs: bigint = BigInt('0')
){}


pack(builder:flatbuffers.Builder): flatbuffers.Offset {
  const inviteId = (this.inviteId !== null ? builder.createString(this.inviteId!) : 0);
  const gameId = (this.gameId !== null ? builder.createString(this.gameId!) : 0);
  const inviterUserId = (this.inviterUserId !== null ? builder.createString(this.inviterUserId!) : 0);
  const invitedUserId = (this.invitedUserId !== null ? builder.createString(this.invitedUserId!) : 0);
  const code = (this.code !== null ? builder.createString(this.code!) : 0);
  const raceName = (this.raceName !== null ? builder.createString(this.raceName!) : 0);
  const status = (this.status !== null ? builder.createString(this.status!) : 0);

  return InviteSummary.createInviteSummary(builder,
    inviteId,
    gameId,
    inviterUserId,
    invitedUserId,
    code,
    raceName,
    status,
    this.createdAtMs,
    this.expiresAtMs,
    this.decidedAtMs
  );
}
}
