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

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

static getSizePrefixedRootAsOpenEnrollmentRequest(bb:flatbuffers.ByteBuffer, obj?:OpenEnrollmentRequest):OpenEnrollmentRequest {
  bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
  return (obj || new OpenEnrollmentRequest()).__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;
}

static startOpenEnrollmentRequest(builder:flatbuffers.Builder) {
  builder.startObject(1);
}

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

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

static createOpenEnrollmentRequest(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset):flatbuffers.Offset {
  OpenEnrollmentRequest.startOpenEnrollmentRequest(builder);
  OpenEnrollmentRequest.addGameId(builder, gameIdOffset);
  return OpenEnrollmentRequest.endOpenEnrollmentRequest(builder);
}

unpack(): OpenEnrollmentRequestT {
  return new OpenEnrollmentRequestT(
    this.gameId()
  );
}


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

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


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

  return OpenEnrollmentRequest.createOpenEnrollmentRequest(builder,
    gameId
  );
}
}
