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

import * as flatbuffers from 'flatbuffers';

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

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

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

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

accept():boolean {
  const offset = this.bb!.__offset(this.bb_pos, 6);
  return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
}

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

static addRequesterId(builder:flatbuffers.Builder, requesterIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, requesterIdOffset, 0);
}

static addAccept(builder:flatbuffers.Builder, accept:boolean) {
  builder.addFieldInt8(1, +accept, +false);
}

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

static createFriendRespondRequest(builder:flatbuffers.Builder, requesterIdOffset:flatbuffers.Offset, accept:boolean):flatbuffers.Offset {
  FriendRespondRequest.startFriendRespondRequest(builder);
  FriendRespondRequest.addRequesterId(builder, requesterIdOffset);
  FriendRespondRequest.addAccept(builder, accept);
  return FriendRespondRequest.endFriendRespondRequest(builder);
}
}
