"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.IceUserNameFragmentT = exports.IceUserNameFragment = void 0;
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
const flatbuffers = require("flatbuffers");
class IceUserNameFragment {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsIceUserNameFragment(bb, obj) {
        return (obj || new IceUserNameFragment()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsIceUserNameFragment(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new IceUserNameFragment()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    localIceUsernameFragment(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    webRtcTransportId(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    static startIceUserNameFragment(builder) {
        builder.startObject(2);
    }
    static addLocalIceUsernameFragment(builder, localIceUsernameFragmentOffset) {
        builder.addFieldOffset(0, localIceUsernameFragmentOffset, 0);
    }
    static addWebRtcTransportId(builder, webRtcTransportIdOffset) {
        builder.addFieldOffset(1, webRtcTransportIdOffset, 0);
    }
    static endIceUserNameFragment(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // local_ice_username_fragment
        builder.requiredField(offset, 6); // web_rtc_transport_id
        return offset;
    }
    static createIceUserNameFragment(builder, localIceUsernameFragmentOffset, webRtcTransportIdOffset) {
        IceUserNameFragment.startIceUserNameFragment(builder);
        IceUserNameFragment.addLocalIceUsernameFragment(builder, localIceUsernameFragmentOffset);
        IceUserNameFragment.addWebRtcTransportId(builder, webRtcTransportIdOffset);
        return IceUserNameFragment.endIceUserNameFragment(builder);
    }
    unpack() {
        return new IceUserNameFragmentT(this.localIceUsernameFragment(), this.webRtcTransportId());
    }
    unpackTo(_o) {
        _o.localIceUsernameFragment = this.localIceUsernameFragment();
        _o.webRtcTransportId = this.webRtcTransportId();
    }
}
exports.IceUserNameFragment = IceUserNameFragment;
class IceUserNameFragmentT {
    localIceUsernameFragment;
    webRtcTransportId;
    constructor(localIceUsernameFragment = null, webRtcTransportId = null) {
        this.localIceUsernameFragment = localIceUsernameFragment;
        this.webRtcTransportId = webRtcTransportId;
    }
    pack(builder) {
        const localIceUsernameFragment = (this.localIceUsernameFragment !== null ? builder.createString(this.localIceUsernameFragment) : 0);
        const webRtcTransportId = (this.webRtcTransportId !== null ? builder.createString(this.webRtcTransportId) : 0);
        return IceUserNameFragment.createIceUserNameFragment(builder, localIceUsernameFragment, webRtcTransportId);
    }
}
exports.IceUserNameFragmentT = IceUserNameFragmentT;
