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

import * as flatbuffers from 'flatbuffers';

export class ComplaintRequest {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):ComplaintRequest {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

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

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

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

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

static startComplaintRequest(builder:flatbuffers.Builder) {
  builder.startObject(3);
}

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

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

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

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

static createComplaintRequest(builder:flatbuffers.Builder, gameIdOffset:flatbuffers.Offset, wordOffset:flatbuffers.Offset, noteOffset:flatbuffers.Offset):flatbuffers.Offset {
  ComplaintRequest.startComplaintRequest(builder);
  ComplaintRequest.addGameId(builder, gameIdOffset);
  ComplaintRequest.addWord(builder, wordOffset);
  ComplaintRequest.addNote(builder, noteOffset);
  return ComplaintRequest.endComplaintRequest(builder);
}
}
