// automatically generated by the FlatBuffers compiler, do not modify
// swiftlint:disable all
// swiftformat:disable all

import FlatBuffers

public struct zzz_DflatGen_PeerConnectionId: FlatBufferObject, Verifiable {

  static func validateVersion() { FlatBuffersVersion_22_9_29() }
  public var __buffer: ByteBuffer! { return _accessor.bb }
  private var _accessor: Table

  public static func getRootAsPeerConnectionId(bb: ByteBuffer) -> zzz_DflatGen_PeerConnectionId {
    return zzz_DflatGen_PeerConnectionId(
      Table(
        bb: bb, position: Int32(bb.read(def: UOffset.self, position: bb.reader)) + Int32(bb.reader))
    )
  }

  private init(_ t: Table) { _accessor = t }
  public init(_ bb: ByteBuffer, o: Int32) { _accessor = Table(bb: bb, position: o) }

  private enum VTOFFSET: VOffset {
    case id = 4
    case updatedAt = 6
    var v: Int32 { Int32(self.rawValue) }
    var p: VOffset { self.rawValue }
  }

  public var id: String? {
    let o = _accessor.offset(VTOFFSET.id.v)
    return o == 0 ? nil : _accessor.string(at: o)
  }
  public var idSegmentArray: [UInt8]? { return _accessor.getVector(at: VTOFFSET.id.v) }
  public var updatedAt: String? {
    let o = _accessor.offset(VTOFFSET.updatedAt.v)
    return o == 0 ? nil : _accessor.string(at: o)
  }
  public var updatedAtSegmentArray: [UInt8]? {
    return _accessor.getVector(at: VTOFFSET.updatedAt.v)
  }
  public static func startPeerConnectionId(_ fbb: inout FlatBufferBuilder) -> UOffset {
    fbb.startTable(with: 2)
  }
  public static func add(id: Offset, _ fbb: inout FlatBufferBuilder) {
    fbb.add(offset: id, at: VTOFFSET.id.p)
  }
  public static func add(updatedAt: Offset, _ fbb: inout FlatBufferBuilder) {
    fbb.add(offset: updatedAt, at: VTOFFSET.updatedAt.p)
  }
  public static func endPeerConnectionId(_ fbb: inout FlatBufferBuilder, start: UOffset) -> Offset {
    let end = Offset(offset: fbb.endTable(at: start))
    return end
  }
  public static func createPeerConnectionId(
    _ fbb: inout FlatBufferBuilder,
    idOffset id: Offset = Offset(),
    updatedAtOffset updatedAt: Offset = Offset()
  ) -> Offset {
    let __start = zzz_DflatGen_PeerConnectionId.startPeerConnectionId(&fbb)
    zzz_DflatGen_PeerConnectionId.add(id: id, &fbb)
    zzz_DflatGen_PeerConnectionId.add(updatedAt: updatedAt, &fbb)
    return zzz_DflatGen_PeerConnectionId.endPeerConnectionId(&fbb, start: __start)
  }

  public static func verify<T>(_ verifier: inout Verifier, at position: Int, of type: T.Type) throws
  where T: Verifiable {
    var _v = try verifier.visitTable(at: position)
    try _v.visit(
      field: VTOFFSET.id.p, fieldName: "id", required: false, type: ForwardOffset<String>.self)
    try _v.visit(
      field: VTOFFSET.updatedAt.p, fieldName: "updatedAt", required: false,
      type: ForwardOffset<String>.self)
    _v.finish()
  }
}
