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

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

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

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

static startUpdateMyProfileRequest(builder:flatbuffers.Builder) {
  builder.startObject(1);
}

static addDisplayName(builder:flatbuffers.Builder, displayNameOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, displayNameOffset, 0);
}

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

static createUpdateMyProfileRequest(builder:flatbuffers.Builder, displayNameOffset:flatbuffers.Offset):flatbuffers.Offset {
  UpdateMyProfileRequest.startUpdateMyProfileRequest(builder);
  UpdateMyProfileRequest.addDisplayName(builder, displayNameOffset);
  return UpdateMyProfileRequest.endUpdateMyProfileRequest(builder);
}

unpack(): UpdateMyProfileRequestT {
  return new UpdateMyProfileRequestT(
    this.displayName()
  );
}


unpackTo(_o: UpdateMyProfileRequestT): void {
  _o.displayName = this.displayName();
}
}

export class UpdateMyProfileRequestT implements flatbuffers.IGeneratedObject {
constructor(
  public displayName: string|Uint8Array|null = null
){}


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

  return UpdateMyProfileRequest.createUpdateMyProfileRequest(builder,
    displayName
  );
}
}
