"use strict";
// automatically generated by the FlatBuffers compiler, do not modify
Object.defineProperty(exports, "__esModule", { value: true });
exports.CloseConsumerRequestT = exports.CloseConsumerRequest = 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 CloseConsumerRequest {
    bb = null;
    bb_pos = 0;
    __init(i, bb) {
        this.bb_pos = i;
        this.bb = bb;
        return this;
    }
    static getRootAsCloseConsumerRequest(bb, obj) {
        return (obj || new CloseConsumerRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    static getSizePrefixedRootAsCloseConsumerRequest(bb, obj) {
        bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
        return (obj || new CloseConsumerRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
    }
    consumerId(optionalEncoding) {
        const offset = this.bb.__offset(this.bb_pos, 4);
        return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
    }
    static startCloseConsumerRequest(builder) {
        builder.startObject(1);
    }
    static addConsumerId(builder, consumerIdOffset) {
        builder.addFieldOffset(0, consumerIdOffset, 0);
    }
    static endCloseConsumerRequest(builder) {
        const offset = builder.endObject();
        builder.requiredField(offset, 4); // consumer_id
        return offset;
    }
    static createCloseConsumerRequest(builder, consumerIdOffset) {
        CloseConsumerRequest.startCloseConsumerRequest(builder);
        CloseConsumerRequest.addConsumerId(builder, consumerIdOffset);
        return CloseConsumerRequest.endCloseConsumerRequest(builder);
    }
    unpack() {
        return new CloseConsumerRequestT(this.consumerId());
    }
    unpackTo(_o) {
        _o.consumerId = this.consumerId();
    }
}
exports.CloseConsumerRequest = CloseConsumerRequest;
class CloseConsumerRequestT {
    consumerId;
    constructor(consumerId = null) {
        this.consumerId = consumerId;
    }
    pack(builder) {
        const consumerId = (this.consumerId !== null ? builder.createString(this.consumerId) : 0);
        return CloseConsumerRequest.createCloseConsumerRequest(builder, consumerId);
    }
}
exports.CloseConsumerRequestT = CloseConsumerRequestT;
