"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConnectResponseT = exports.ConnectResponse = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const flatbuffers = require("flatbuffers");
const dtls_role_1 = require("../../fbs/web-rtc-transport/dtls-role");
class ConnectResponse {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsConnectResponse(bb, obj) {
        return (obj || new ConnectResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsConnectResponse(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new ConnectResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    dtlsLocalRole() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint8(this.bb_pos + offset) : dtls_role_1.DtlsRole.AUTO;
    }
    static startConnectResponse(builder) {
        builder.startObject(1);
    }
    static addDtlsLocalRole(builder, dtlsLocalRole) {
        builder.addFieldInt8(0, dtlsLocalRole, dtls_role_1.DtlsRole.AUTO);
    }
    static endConnectResponse(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createConnectResponse(builder, dtlsLocalRole) {
        ConnectResponse.startConnectResponse(builder);
        ConnectResponse.addDtlsLocalRole(builder, dtlsLocalRole);
        return ConnectResponse.endConnectResponse(builder);
    }
    unpack() {
        return new ConnectResponseT(this.dtlsLocalRole());
    }
    unpackTo(_o) {
        _o.dtlsLocalRole = this.dtlsLocalRole();
    }
}
exports.ConnectResponse = ConnectResponse;
class ConnectResponseT {
    dtlsLocalRole;
    constructor(dtlsLocalRole = dtls_role_1.DtlsRole.AUTO) {
        this.dtlsLocalRole = dtlsLocalRole;
    }
    pack(builder) {
        return ConnectResponse.createConnectResponse(builder, this.dtlsLocalRole);
    }
}
exports.ConnectResponseT = ConnectResponseT;
