// 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 { DeviceSessionRevocationSummaryView, DeviceSessionRevocationSummaryViewT } from '../user/device-session-revocation-summary-view.js';


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

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

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

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

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

static addSummary(builder:flatbuffers.Builder, summaryOffset:flatbuffers.Offset) {
  builder.addFieldOffset(0, summaryOffset, 0);
}

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

static createRevokeAllMySessionsResponse(builder:flatbuffers.Builder, summaryOffset:flatbuffers.Offset):flatbuffers.Offset {
  RevokeAllMySessionsResponse.startRevokeAllMySessionsResponse(builder);
  RevokeAllMySessionsResponse.addSummary(builder, summaryOffset);
  return RevokeAllMySessionsResponse.endRevokeAllMySessionsResponse(builder);
}

unpack(): RevokeAllMySessionsResponseT {
  return new RevokeAllMySessionsResponseT(
    (this.summary() !== null ? this.summary()!.unpack() : null)
  );
}


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

export class RevokeAllMySessionsResponseT implements flatbuffers.IGeneratedObject {
constructor(
  public summary: DeviceSessionRevocationSummaryViewT|null = null
){}


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

  return RevokeAllMySessionsResponse.createRevokeAllMySessionsResponse(builder,
    summary
  );
}
}
