"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpdateSettingsRequestT = exports.UpdateSettingsRequest = 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 UpdateSettingsRequest {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsUpdateSettingsRequest(bb, obj) {
        return (obj || new UpdateSettingsRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsUpdateSettingsRequest(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new UpdateSettingsRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    logLevel(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    logTags(index, optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.__string(this.bb.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
    }
    logTagsLength() {
        const offset = this.bb.__offset(this.bb_pos, 6);
        return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
    }
    static startUpdateSettingsRequest(builder) {
        builder.startObject(2);
    }
    static addLogLevel(builder, logLevelOffset) {
        builder.addFieldOffset(0, logLevelOffset, 0);
    }
    static addLogTags(builder, logTagsOffset) {
        builder.addFieldOffset(1, logTagsOffset, 0);
    }
    static createLogTagsVector(builder, data) {
        builder.startVector(4, data.length, 4);
        for (let i = data.length - 1; i >= 0; i--) {
            builder.addOffset(data[i]);
        }
        return builder.endVector();
    }
    static startLogTagsVector(builder, numElems) {
        builder.startVector(4, numElems, 4);
    }
    static endUpdateSettingsRequest(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createUpdateSettingsRequest(builder, logLevelOffset, logTagsOffset) {
        UpdateSettingsRequest.startUpdateSettingsRequest(builder);
        UpdateSettingsRequest.addLogLevel(builder, logLevelOffset);
        UpdateSettingsRequest.addLogTags(builder, logTagsOffset);
        return UpdateSettingsRequest.endUpdateSettingsRequest(builder);
    }
    unpack() {
        return new UpdateSettingsRequestT(this.logLevel(), this.bb.createScalarList(this.logTags.bind(this), this.logTagsLength()));
    }
    unpackTo(_o) {
        _o.logLevel = this.logLevel();
        _o.logTags = this.bb.createScalarList(this.logTags.bind(this), this.logTagsLength());
    }
}
exports.UpdateSettingsRequest = UpdateSettingsRequest;
class UpdateSettingsRequestT {
    logLevel;
    logTags;
    constructor(logLevel = null, logTags = []) {
        this.logLevel = logLevel;
        this.logTags = logTags;
    }
    pack(builder) {
        const logLevel = (this.logLevel !== null ? builder.createString(this.logLevel) : 0);
        const logTags = UpdateSettingsRequest.createLogTagsVector(builder, builder.createObjectOffsetList(this.logTags));
        return UpdateSettingsRequest.createUpdateSettingsRequest(builder, logLevel, logTags);
    }
}
exports.UpdateSettingsRequestT = UpdateSettingsRequestT;
