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

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

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

status():string|null
status(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
status(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 startOpenEnrollmentResponse(builder:flatbuffers.Builder) {
  builder.startObject(2);
}

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

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

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

static createOpenEnrollmentResponse(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset, statusOffset:flatbuffers.Offset):flatbuffers.Offset {
  OpenEnrollmentResponse.startOpenEnrollmentResponse(builder);
  OpenEnrollmentResponse.addGameId(builder, gameIdOffset);
  OpenEnrollmentResponse.addStatus(builder, statusOffset);
  return OpenEnrollmentResponse.endOpenEnrollmentResponse(builder);
}

unpack(): OpenEnrollmentResponseT {
  return new OpenEnrollmentResponseT(
    this.gameId(),
    this.status()
  );
}


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

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


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

  return OpenEnrollmentResponse.createOpenEnrollmentResponse(builder,
    gameId,
    status
  );
}
}
