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

import * as flatbuffers from 'flatbuffers';

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

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

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

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

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

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

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

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

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

notificationsInAppOnly():boolean {
  const offset = this.bb!.__offset(this.bb_pos, 18);
  return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : true;
}

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

variantPreferencesLength():number {
  const offset = this.bb!.__offset(this.bb_pos, 20);
  return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
}

static startUpdateProfileRequest(builder:flatbuffers.Builder) {
  builder.startObject(9);
}

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

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

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

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

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

static addBlockChat(builder:flatbuffers.Builder, blockChat:boolean) {
  builder.addFieldInt8(5, +blockChat, +false);
}

static addBlockFriendRequests(builder:flatbuffers.Builder, blockFriendRequests:boolean) {
  builder.addFieldInt8(6, +blockFriendRequests, +false);
}

static addNotificationsInAppOnly(builder:flatbuffers.Builder, notificationsInAppOnly:boolean) {
  builder.addFieldInt8(7, +notificationsInAppOnly, +true);
}

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

static createVariantPreferencesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
  builder.startVector(4, data.length, 4);
  for (let i = data.length - 1; i >= 0; i--) {
    builder.addOffset(data[i]!);
  }
  return builder.endVector();
}

static startVariantPreferencesVector(builder:flatbuffers.Builder, numElems:number) {
  builder.startVector(4, numElems, 4);
}

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

static createUpdateProfileRequest(builder:flatbuffers.Builder, displayNameOffset:flatbuffers.Offset, preferredLanguageOffset:flatbuffers.Offset, timeZoneOffset:flatbuffers.Offset, awayStartOffset:flatbuffers.Offset, awayEndOffset:flatbuffers.Offset, blockChat:boolean, blockFriendRequests:boolean, notificationsInAppOnly:boolean, variantPreferencesOffset:flatbuffers.Offset):flatbuffers.Offset {
  UpdateProfileRequest.startUpdateProfileRequest(builder);
  UpdateProfileRequest.addDisplayName(builder, displayNameOffset);
  UpdateProfileRequest.addPreferredLanguage(builder, preferredLanguageOffset);
  UpdateProfileRequest.addTimeZone(builder, timeZoneOffset);
  UpdateProfileRequest.addAwayStart(builder, awayStartOffset);
  UpdateProfileRequest.addAwayEnd(builder, awayEndOffset);
  UpdateProfileRequest.addBlockChat(builder, blockChat);
  UpdateProfileRequest.addBlockFriendRequests(builder, blockFriendRequests);
  UpdateProfileRequest.addNotificationsInAppOnly(builder, notificationsInAppOnly);
  UpdateProfileRequest.addVariantPreferences(builder, variantPreferencesOffset);
  return UpdateProfileRequest.endUpdateProfileRequest(builder);
}
}
