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

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

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

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

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

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

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

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

recipientCount():number {
  const offset = this.bb!.__offset(this.bb_pos, 24);
  return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
}

static startMailBroadcastReceipt(builder:flatbuffers.Builder) {
  builder.startObject(11);
}

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 addSubject(builder:flatbuffers.Builder, subjectOffset:flatbuffers.Offset) {
  builder.addFieldOffset(5, subjectOffset, 0);
}

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

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

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

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

static addRecipientCount(builder:flatbuffers.Builder, recipientCount:number) {
  builder.addFieldInt32(10, recipientCount, 0);
}

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

static createMailBroadcastReceipt(builder:flatbuffers.Builder, messageIdOffset:flatbuffers.Offset, gameIdOffset:flatbuffers.Offset, gameNameOffset:flatbuffers.Offset, kindOffset:flatbuffers.Offset, senderKindOffset:flatbuffers.Offset, subjectOffset:flatbuffers.Offset, bodyOffset:flatbuffers.Offset, bodyLangOffset:flatbuffers.Offset, broadcastScopeOffset:flatbuffers.Offset, createdAtMs:bigint, recipientCount:number):flatbuffers.Offset {
  MailBroadcastReceipt.startMailBroadcastReceipt(builder);
  MailBroadcastReceipt.addMessageId(builder, messageIdOffset);
  MailBroadcastReceipt.addGameId(builder, gameIdOffset);
  MailBroadcastReceipt.addGameName(builder, gameNameOffset);
  MailBroadcastReceipt.addKind(builder, kindOffset);
  MailBroadcastReceipt.addSenderKind(builder, senderKindOffset);
  MailBroadcastReceipt.addSubject(builder, subjectOffset);
  MailBroadcastReceipt.addBody(builder, bodyOffset);
  MailBroadcastReceipt.addBodyLang(builder, bodyLangOffset);
  MailBroadcastReceipt.addBroadcastScope(builder, broadcastScopeOffset);
  MailBroadcastReceipt.addCreatedAtMs(builder, createdAtMs);
  MailBroadcastReceipt.addRecipientCount(builder, recipientCount);
  return MailBroadcastReceipt.endMailBroadcastReceipt(builder);
}

unpack(): MailBroadcastReceiptT {
  return new MailBroadcastReceiptT(
    this.messageId(),
    this.gameId(),
    this.gameName(),
    this.kind(),
    this.senderKind(),
    this.subject(),
    this.body(),
    this.bodyLang(),
    this.broadcastScope(),
    this.createdAtMs(),
    this.recipientCount()
  );
}


unpackTo(_o: MailBroadcastReceiptT): void {
  _o.messageId = this.messageId();
  _o.gameId = this.gameId();
  _o.gameName = this.gameName();
  _o.kind = this.kind();
  _o.senderKind = this.senderKind();
  _o.subject = this.subject();
  _o.body = this.body();
  _o.bodyLang = this.bodyLang();
  _o.broadcastScope = this.broadcastScope();
  _o.createdAtMs = this.createdAtMs();
  _o.recipientCount = this.recipientCount();
}
}

export class MailBroadcastReceiptT 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 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 recipientCount: number = 0
){}


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 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);

  return MailBroadcastReceipt.createMailBroadcastReceipt(builder,
    messageId,
    gameId,
    gameName,
    kind,
    senderKind,
    subject,
    body,
    bodyLang,
    broadcastScope,
    this.createdAtMs,
    this.recipientCount
  );
}
}
