"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.SetPreferredLayersResponseT = exports.SetPreferredLayersResponse = 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 consumer_layers_1 = require("../../fbs/consumer/consumer-layers");
class SetPreferredLayersResponse {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsSetPreferredLayersResponse(bb, obj) {
        return (obj || new SetPreferredLayersResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsSetPreferredLayersResponse(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new SetPreferredLayersResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    preferredLayers(obj) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? (obj || new consumer_layers_1.ConsumerLayers()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
    }
    static startSetPreferredLayersResponse(builder) {
        builder.startObject(1);
    }
    static addPreferredLayers(builder, preferredLayersOffset) {
        builder.addFieldOffset(0, preferredLayersOffset, 0);
    }
    static endSetPreferredLayersResponse(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createSetPreferredLayersResponse(builder, preferredLayersOffset) {
        SetPreferredLayersResponse.startSetPreferredLayersResponse(builder);
        SetPreferredLayersResponse.addPreferredLayers(builder, preferredLayersOffset);
        return SetPreferredLayersResponse.endSetPreferredLayersResponse(builder);
    }
    unpack() {
        return new SetPreferredLayersResponseT((this.preferredLayers() !== null ? this.preferredLayers().unpack() : null));
    }
    unpackTo(_o) {
        _o.preferredLayers = (this.preferredLayers() !== null ? this.preferredLayers().unpack() : null);
    }
}
exports.SetPreferredLayersResponse = SetPreferredLayersResponse;
class SetPreferredLayersResponseT {
    preferredLayers;
    constructor(preferredLayers = null) {
        this.preferredLayers = preferredLayers;
    }
    pack(builder) {
        const preferredLayers = (this.preferredLayers !== null ? this.preferredLayers.pack(builder) : 0);
        return SetPreferredLayersResponse.createSetPreferredLayersResponse(builder, preferredLayers);
    }
}
exports.SetPreferredLayersResponseT = SetPreferredLayersResponseT;
