"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProduceResponseT = exports.ProduceResponse = 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 type_1 = require("../../fbs/rtp-parameters/type");
class ProduceResponse {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsProduceResponse(bb, obj) {
        return (obj || new ProduceResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsProduceResponse(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new ProduceResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    type() {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.readUint8(this.bb_pos + offset) : type_1.Type.SIMPLE;
    }
    static startProduceResponse(builder) {
        builder.startObject(1);
    }
    static addType(builder, type) {
        builder.addFieldInt8(0, type, type_1.Type.SIMPLE);
    }
    static endProduceResponse(builder) {
        const offset = builder.endObject();
        return offset;
    }
    static createProduceResponse(builder, type) {
        ProduceResponse.startProduceResponse(builder);
        ProduceResponse.addType(builder, type);
        return ProduceResponse.endProduceResponse(builder);
    }
    unpack() {
        return new ProduceResponseT(this.type());
    }
    unpackTo(_o) {
        _o.type = this.type();
    }
}
exports.ProduceResponse = ProduceResponse;
class ProduceResponseT {
    type;
    constructor(type = type_1.Type.SIMPLE) {
        this.type = type;
    }
    pack(builder) {
        return ProduceResponse.createProduceResponse(builder, this.type);
    }
}
exports.ProduceResponseT = ProduceResponseT;
