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

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

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

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

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

static startInviteRedeemRequest(builder:flatbuffers.Builder) {
  builder.startObject(2);
}

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

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

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

static createInviteRedeemRequest(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset, inviteIdOffset:flatbuffers.Offset):flatbuffers.Offset {
  InviteRedeemRequest.startInviteRedeemRequest(builder);
  InviteRedeemRequest.addGameId(builder, gameIdOffset);
  InviteRedeemRequest.addInviteId(builder, inviteIdOffset);
  return InviteRedeemRequest.endInviteRedeemRequest(builder);
}

unpack(): InviteRedeemRequestT {
  return new InviteRedeemRequestT(
    this.gameId(),
    this.inviteId()
  );
}


unpackTo(_o: InviteRedeemRequestT): void {
  _o.gameId = this.gameId();
  _o.inviteId = this.inviteId();
}
}

export class InviteRedeemRequestT implements flatbuffers.IGeneratedObject {
constructor(
  public gameId: string|Uint8Array|null = null,
  public inviteId: string|Uint8Array|null = null
){}


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

  return InviteRedeemRequest.createInviteRedeemRequest(builder,
    gameId,
    inviteId
  );
}
}
