// 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';

import { DeviceSessionView, DeviceSessionViewT } from '../user/device-session-view.js';


export class RevokeMySessionResponse implements flatbuffers.IUnpackableObject<RevokeMySessionResponseT> {
  bb: flatbuffers.ByteBuffer|null = null;
  bb_pos = 0;
  __init(i:number, bb:flatbuffers.ByteBuffer):RevokeMySessionResponse {
  this.bb_pos = i;
  this.bb = bb;
  return this;
}

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

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

session(obj?:DeviceSessionView):DeviceSessionView|null {
  const offset = this.bb!.__offset(this.bb_pos, 4);
  return offset ? (obj || new DeviceSessionView()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
}

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

static addSession(builder:flatbuffers.Builder, sessionOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, sessionOffset, 0);
}

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

static createRevokeMySessionResponse(builder:flatbuffers.Builder, sessionOffset:flatbuffers.Offset):flatbuffers.Offset {
  RevokeMySessionResponse.startRevokeMySessionResponse(builder);
  RevokeMySessionResponse.addSession(builder, sessionOffset);
  return RevokeMySessionResponse.endRevokeMySessionResponse(builder);
}

unpack(): RevokeMySessionResponseT {
  return new RevokeMySessionResponseT(
    (this.session() !== null ? this.session()!.unpack() : null)
  );
}


unpackTo(_o: RevokeMySessionResponseT): void {
  _o.session = (this.session() !== null ? this.session()!.unpack() : null);
}
}

export class RevokeMySessionResponseT implements flatbuffers.IGeneratedObject {
constructor(
  public session: DeviceSessionViewT|null = null
){}


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

  return RevokeMySessionResponse.createRevokeMySessionResponse(builder,
    session
  );
}
}
