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

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

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

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

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

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

kind():string|null
kind(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
kind(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 10);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

senderKind():string|null
senderKind(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
senderKind(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 12);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

senderUserId():string|null
senderUserId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
senderUserId(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 14);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

senderUsername():string|null
senderUsername(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
senderUsername(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 16);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

senderRaceName():string|null
senderRaceName(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
senderRaceName(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 18);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

subject():string|null
subject(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
subject(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 20);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

body():string|null
body(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
body(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 22);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

bodyLang():string|null
bodyLang(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
bodyLang(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 24);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

broadcastScope():string|null
broadcastScope(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
broadcastScope(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 26);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

createdAtMs():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 28);
  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}

recipientUserId():string|null
recipientUserId(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
recipientUserId(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 30);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

recipientUserName():string|null
recipientUserName(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
recipientUserName(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 32);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

recipientRaceName():string|null
recipientRaceName(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
recipientRaceName(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 34);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

readAtMs():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 36);
  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}

deletedAtMs():bigint {
  const offset = this.bb!.__offset(this.bb_pos, 38);
  return offset ? this.bb!.readInt64(this.bb_pos + offset) : BigInt('0');
}

translatedSubject():string|null
translatedSubject(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
translatedSubject(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 40);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

translatedBody():string|null
translatedBody(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
translatedBody(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 42);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

translationLang():string|null
translationLang(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
translationLang(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 44);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

translator():string|null
translator(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
translator(optionalEncoding?:any):string|Uint8Array|null {
  const offset = this.bb!.__offset(this.bb_pos, 46);
  return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
}

static startMailMessage(builder:flatbuffers.Builder) {
  builder.startObject(22);
}

static addMessageId(builder:flatbuffers.Builder, messageIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, messageIdOffset, 0);
}

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

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

static addKind(builder:flatbuffers.Builder, kindOffset:flatbuffers.Offset) {
  builder.addFieldOffset(3, kindOffset, 0);
}

static addSenderKind(builder:flatbuffers.Builder, senderKindOffset:flatbuffers.Offset) {
  builder.addFieldOffset(4, senderKindOffset, 0);
}

static addSenderUserId(builder:flatbuffers.Builder, senderUserIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(5, senderUserIdOffset, 0);
}

static addSenderUsername(builder:flatbuffers.Builder, senderUsernameOffset:flatbuffers.Offset) {
  builder.addFieldOffset(6, senderUsernameOffset, 0);
}

static addSenderRaceName(builder:flatbuffers.Builder, senderRaceNameOffset:flatbuffers.Offset) {
  builder.addFieldOffset(7, senderRaceNameOffset, 0);
}

static addSubject(builder:flatbuffers.Builder, subjectOffset:flatbuffers.Offset) {
  builder.addFieldOffset(8, subjectOffset, 0);
}

static addBody(builder:flatbuffers.Builder, bodyOffset:flatbuffers.Offset) {
  builder.addFieldOffset(9, bodyOffset, 0);
}

static addBodyLang(builder:flatbuffers.Builder, bodyLangOffset:flatbuffers.Offset) {
  builder.addFieldOffset(10, bodyLangOffset, 0);
}

static addBroadcastScope(builder:flatbuffers.Builder, broadcastScopeOffset:flatbuffers.Offset) {
  builder.addFieldOffset(11, broadcastScopeOffset, 0);
}

static addCreatedAtMs(builder:flatbuffers.Builder, createdAtMs:bigint) {
  builder.addFieldInt64(12, createdAtMs, BigInt('0'));
}

static addRecipientUserId(builder:flatbuffers.Builder, recipientUserIdOffset:flatbuffers.Offset) {
  builder.addFieldOffset(13, recipientUserIdOffset, 0);
}

static addRecipientUserName(builder:flatbuffers.Builder, recipientUserNameOffset:flatbuffers.Offset) {
  builder.addFieldOffset(14, recipientUserNameOffset, 0);
}

static addRecipientRaceName(builder:flatbuffers.Builder, recipientRaceNameOffset:flatbuffers.Offset) {
  builder.addFieldOffset(15, recipientRaceNameOffset, 0);
}

static addReadAtMs(builder:flatbuffers.Builder, readAtMs:bigint) {
  builder.addFieldInt64(16, readAtMs, BigInt('0'));
}

static addDeletedAtMs(builder:flatbuffers.Builder, deletedAtMs:bigint) {
  builder.addFieldInt64(17, deletedAtMs, BigInt('0'));
}

static addTranslatedSubject(builder:flatbuffers.Builder, translatedSubjectOffset:flatbuffers.Offset) {
  builder.addFieldOffset(18, translatedSubjectOffset, 0);
}

static addTranslatedBody(builder:flatbuffers.Builder, translatedBodyOffset:flatbuffers.Offset) {
  builder.addFieldOffset(19, translatedBodyOffset, 0);
}

static addTranslationLang(builder:flatbuffers.Builder, translationLangOffset:flatbuffers.Offset) {
  builder.addFieldOffset(20, translationLangOffset, 0);
}

static addTranslator(builder:flatbuffers.Builder, translatorOffset:flatbuffers.Offset) {
  builder.addFieldOffset(21, translatorOffset, 0);
}

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

static createMailMessage(builder:flatbuffers.Builder, messageIdOffset:flatbuffers.Offset, gameIdOffset:flatbuffers.Offset, gameNameOffset:flatbuffers.Offset, kindOffset:flatbuffers.Offset, senderKindOffset:flatbuffers.Offset, senderUserIdOffset:flatbuffers.Offset, senderUsernameOffset:flatbuffers.Offset, senderRaceNameOffset:flatbuffers.Offset, subjectOffset:flatbuffers.Offset, bodyOffset:flatbuffers.Offset, bodyLangOffset:flatbuffers.Offset, broadcastScopeOffset:flatbuffers.Offset, createdAtMs:bigint, recipientUserIdOffset:flatbuffers.Offset, recipientUserNameOffset:flatbuffers.Offset, recipientRaceNameOffset:flatbuffers.Offset, readAtMs:bigint, deletedAtMs:bigint, translatedSubjectOffset:flatbuffers.Offset, translatedBodyOffset:flatbuffers.Offset, translationLangOffset:flatbuffers.Offset, translatorOffset:flatbuffers.Offset):flatbuffers.Offset {
  MailMessage.startMailMessage(builder);
  MailMessage.addMessageId(builder, messageIdOffset);
  MailMessage.addGameId(builder, gameIdOffset);
  MailMessage.addGameName(builder, gameNameOffset);
  MailMessage.addKind(builder, kindOffset);
  MailMessage.addSenderKind(builder, senderKindOffset);
  MailMessage.addSenderUserId(builder, senderUserIdOffset);
  MailMessage.addSenderUsername(builder, senderUsernameOffset);
  MailMessage.addSenderRaceName(builder, senderRaceNameOffset);
  MailMessage.addSubject(builder, subjectOffset);
  MailMessage.addBody(builder, bodyOffset);
  MailMessage.addBodyLang(builder, bodyLangOffset);
  MailMessage.addBroadcastScope(builder, broadcastScopeOffset);
  MailMessage.addCreatedAtMs(builder, createdAtMs);
  MailMessage.addRecipientUserId(builder, recipientUserIdOffset);
  MailMessage.addRecipientUserName(builder, recipientUserNameOffset);
  MailMessage.addRecipientRaceName(builder, recipientRaceNameOffset);
  MailMessage.addReadAtMs(builder, readAtMs);
  MailMessage.addDeletedAtMs(builder, deletedAtMs);
  MailMessage.addTranslatedSubject(builder, translatedSubjectOffset);
  MailMessage.addTranslatedBody(builder, translatedBodyOffset);
  MailMessage.addTranslationLang(builder, translationLangOffset);
  MailMessage.addTranslator(builder, translatorOffset);
  return MailMessage.endMailMessage(builder);
}

unpack(): MailMessageT {
  return new MailMessageT(
    this.messageId(),
    this.gameId(),
    this.gameName(),
    this.kind(),
    this.senderKind(),
    this.senderUserId(),
    this.senderUsername(),
    this.senderRaceName(),
    this.subject(),
    this.body(),
    this.bodyLang(),
    this.broadcastScope(),
    this.createdAtMs(),
    this.recipientUserId(),
    this.recipientUserName(),
    this.recipientRaceName(),
    this.readAtMs(),
    this.deletedAtMs(),
    this.translatedSubject(),
    this.translatedBody(),
    this.translationLang(),
    this.translator()
  );
}


unpackTo(_o: MailMessageT): void {
  _o.messageId = this.messageId();
  _o.gameId = this.gameId();
  _o.gameName = this.gameName();
  _o.kind = this.kind();
  _o.senderKind = this.senderKind();
  _o.senderUserId = this.senderUserId();
  _o.senderUsername = this.senderUsername();
  _o.senderRaceName = this.senderRaceName();
  _o.subject = this.subject();
  _o.body = this.body();
  _o.bodyLang = this.bodyLang();
  _o.broadcastScope = this.broadcastScope();
  _o.createdAtMs = this.createdAtMs();
  _o.recipientUserId = this.recipientUserId();
  _o.recipientUserName = this.recipientUserName();
  _o.recipientRaceName = this.recipientRaceName();
  _o.readAtMs = this.readAtMs();
  _o.deletedAtMs = this.deletedAtMs();
  _o.translatedSubject = this.translatedSubject();
  _o.translatedBody = this.translatedBody();
  _o.translationLang = this.translationLang();
  _o.translator = this.translator();
}
}

export class MailMessageT implements flatbuffers.IGeneratedObject {
constructor(
  public messageId: string|Uint8Array|null = null,
  public gameId: string|Uint8Array|null = null,
  public gameName: string|Uint8Array|null = null,
  public kind: string|Uint8Array|null = null,
  public senderKind: string|Uint8Array|null = null,
  public senderUserId: string|Uint8Array|null = null,
  public senderUsername: string|Uint8Array|null = null,
  public senderRaceName: string|Uint8Array|null = null,
  public subject: string|Uint8Array|null = null,
  public body: string|Uint8Array|null = null,
  public bodyLang: string|Uint8Array|null = null,
  public broadcastScope: string|Uint8Array|null = null,
  public createdAtMs: bigint = BigInt('0'),
  public recipientUserId: string|Uint8Array|null = null,
  public recipientUserName: string|Uint8Array|null = null,
  public recipientRaceName: string|Uint8Array|null = null,
  public readAtMs: bigint = BigInt('0'),
  public deletedAtMs: bigint = BigInt('0'),
  public translatedSubject: string|Uint8Array|null = null,
  public translatedBody: string|Uint8Array|null = null,
  public translationLang: string|Uint8Array|null = null,
  public translator: string|Uint8Array|null = null
){}


pack(builder:flatbuffers.Builder): flatbuffers.Offset {
  const messageId = (this.messageId !== null ? builder.createString(this.messageId!) : 0);
  const gameId = (this.gameId !== null ? builder.createString(this.gameId!) : 0);
  const gameName = (this.gameName !== null ? builder.createString(this.gameName!) : 0);
  const kind = (this.kind !== null ? builder.createString(this.kind!) : 0);
  const senderKind = (this.senderKind !== null ? builder.createString(this.senderKind!) : 0);
  const senderUserId = (this.senderUserId !== null ? builder.createString(this.senderUserId!) : 0);
  const senderUsername = (this.senderUsername !== null ? builder.createString(this.senderUsername!) : 0);
  const senderRaceName = (this.senderRaceName !== null ? builder.createString(this.senderRaceName!) : 0);
  const subject = (this.subject !== null ? builder.createString(this.subject!) : 0);
  const body = (this.body !== null ? builder.createString(this.body!) : 0);
  const bodyLang = (this.bodyLang !== null ? builder.createString(this.bodyLang!) : 0);
  const broadcastScope = (this.broadcastScope !== null ? builder.createString(this.broadcastScope!) : 0);
  const recipientUserId = (this.recipientUserId !== null ? builder.createString(this.recipientUserId!) : 0);
  const recipientUserName = (this.recipientUserName !== null ? builder.createString(this.recipientUserName!) : 0);
  const recipientRaceName = (this.recipientRaceName !== null ? builder.createString(this.recipientRaceName!) : 0);
  const translatedSubject = (this.translatedSubject !== null ? builder.createString(this.translatedSubject!) : 0);
  const translatedBody = (this.translatedBody !== null ? builder.createString(this.translatedBody!) : 0);
  const translationLang = (this.translationLang !== null ? builder.createString(this.translationLang!) : 0);
  const translator = (this.translator !== null ? builder.createString(this.translator!) : 0);

  return MailMessage.createMailMessage(builder,
    messageId,
    gameId,
    gameName,
    kind,
    senderKind,
    senderUserId,
    senderUsername,
    senderRaceName,
    subject,
    body,
    bodyLang,
    broadcastScope,
    this.createdAtMs,
    recipientUserId,
    recipientUserName,
    recipientRaceName,
    this.readAtMs,
    this.deletedAtMs,
    translatedSubject,
    translatedBody,
    translationLang,
    translator
  );
}
}
