"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.RestartIceResponseT = exports.RestartIceResponse = 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 RestartIceResponse {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsRestartIceResponse(bb, obj) {
        return (obj || new RestartIceResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsRestartIceResponse(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new RestartIceResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    usernameFragment(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    password(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    iceLite() {
        const offset = this.bb.__offset(this.bb_pos, 8);
        return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
    }
    static startRestartIceResponse(builder) {
        builder.startObject(3);
    }
    static addUsernameFragment(builder, usernameFragmentOffset) {
        builder.addFieldOffset(0, usernameFragmentOffset, 0);
    }
    static addPassword(builder, passwordOffset) {
        builder.addFieldOffset(1, passwordOffset, 0);
    }
    static addIceLite(builder, iceLite) {
        builder.addFieldInt8(2, +iceLite, +false);
    }
    static endRestartIceResponse(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // username_fragment
        builder.requiredField(offset, 6); // password
        return offset;
    }
    static createRestartIceResponse(builder, usernameFragmentOffset, passwordOffset, iceLite) {
        RestartIceResponse.startRestartIceResponse(builder);
        RestartIceResponse.addUsernameFragment(builder, usernameFragmentOffset);
        RestartIceResponse.addPassword(builder, passwordOffset);
        RestartIceResponse.addIceLite(builder, iceLite);
        return RestartIceResponse.endRestartIceResponse(builder);
    }
    unpack() {
        return new RestartIceResponseT(this.usernameFragment(), this.password(), this.iceLite());
    }
    unpackTo(_o) {
        _o.usernameFragment = this.usernameFragment();
        _o.password = this.password();
        _o.iceLite = this.iceLite();
    }
}
exports.RestartIceResponse = RestartIceResponse;
class RestartIceResponseT {
    usernameFragment;
    password;
    iceLite;
    constructor(usernameFragment = null, password = null, iceLite = false) {
        this.usernameFragment = usernameFragment;
        this.password = password;
        this.iceLite = iceLite;
    }
    pack(builder) {
        const usernameFragment = (this.usernameFragment !== null ? builder.createString(this.usernameFragment) : 0);
        const password = (this.password !== null ? builder.createString(this.password) : 0);
        return RestartIceResponse.createRestartIceResponse(builder, usernameFragment, password, this.iceLite);
    }
}
exports.RestartIceResponseT = RestartIceResponseT;
