//------------------------------------------------------------------------------
// Automatically generated by the Fast Binary Encoding compiler, do not modify!
// https://github.com/chronoxor/FastBinaryEncoding
// Source: message.fbe
// FBE version: 1.14.5.0
//------------------------------------------------------------------------------

#pragma once

#if defined(__clang__)
#pragma clang system_header
#elif defined(__GNUC__)
#pragma GCC system_header
#elif defined(_MSC_VER)
#pragma system_header
#endif

#include "fbe_final_models.h"

#include "proto.h"

namespace FBE {

// Fast Binary Encoding ::proto::OriginMessage final model
template <>
class FinalModel<::proto::OriginMessage>
{
public:
    FinalModel(FBEBuffer& buffer, size_t offset) noexcept;

    // Get the allocation size
    size_t fbe_allocation_size(const ::proto::OriginMessage& fbe_value) const noexcept;
    // Get the final offset
    size_t fbe_offset() const noexcept { return _offset; }
    // Set the final offset
    size_t fbe_offset(size_t offset) const noexcept { return _offset = offset; }
    // Get the final type
    static constexpr size_t fbe_type() noexcept { return 1; }

    // Shift the current final offset
    void fbe_shift(size_t size) noexcept { _offset += size; }
    // Unshift the current final offset
    void fbe_unshift(size_t size) noexcept { _offset -= size; }

    // Check if the struct value is valid
    size_t verify() const noexcept;
    // Check if the struct fields are valid
    size_t verify_fields() const noexcept;

    // Get the struct value
    size_t get(::proto::OriginMessage& fbe_value) const noexcept;
    // Get the struct fields values
    size_t get_fields(::proto::OriginMessage& fbe_value) const noexcept;

    // Set the struct value
    size_t set(const ::proto::OriginMessage& fbe_value) noexcept;
    // Set the struct fields values
    size_t set_fields(const ::proto::OriginMessage& fbe_value) noexcept;

private:
    FBEBuffer& _buffer;
    mutable size_t _offset;

public:
    FinalModel<FBE::uuid_t> id;
    FinalModel<int32_t> mask;
    FinalModel<std::string> json_msg;
};

namespace proto {

// Fast Binary Encoding OriginMessage final model
class OriginMessageFinalModel : public FBE::Model
{
public:
    OriginMessageFinalModel() : _model(this->buffer(), 8) {}
    OriginMessageFinalModel(const std::shared_ptr<FBEBuffer>& buffer) : FBE::Model(buffer), _model(this->buffer(), 8) {}

    // Get the model type
    static constexpr size_t fbe_type() noexcept { return FinalModel<::proto::OriginMessage>::fbe_type(); }

    // Check if the struct value is valid
    bool verify();

    // Serialize the struct value
    size_t serialize(const ::proto::OriginMessage& value);
    // Deserialize the struct value
    size_t deserialize(::proto::OriginMessage& value) const noexcept;

    // Move to the next struct value
    void next(size_t prev) noexcept { _model.fbe_shift(prev); }

private:
    FinalModel<::proto::OriginMessage> _model;
};

} // namespace proto

// Fast Binary Encoding ::proto::MessageReject final model
template <>
class FinalModel<::proto::MessageReject>
{
public:
    FinalModel(FBEBuffer& buffer, size_t offset) noexcept;

    // Get the allocation size
    size_t fbe_allocation_size(const ::proto::MessageReject& fbe_value) const noexcept;
    // Get the final offset
    size_t fbe_offset() const noexcept { return _offset; }
    // Set the final offset
    size_t fbe_offset(size_t offset) const noexcept { return _offset = offset; }
    // Get the final type
    static constexpr size_t fbe_type() noexcept { return 2; }

    // Shift the current final offset
    void fbe_shift(size_t size) noexcept { _offset += size; }
    // Unshift the current final offset
    void fbe_unshift(size_t size) noexcept { _offset -= size; }

    // Check if the struct value is valid
    size_t verify() const noexcept;
    // Check if the struct fields are valid
    size_t verify_fields() const noexcept;

    // Get the struct value
    size_t get(::proto::MessageReject& fbe_value) const noexcept;
    // Get the struct fields values
    size_t get_fields(::proto::MessageReject& fbe_value) const noexcept;

    // Set the struct value
    size_t set(const ::proto::MessageReject& fbe_value) noexcept;
    // Set the struct fields values
    size_t set_fields(const ::proto::MessageReject& fbe_value) noexcept;

private:
    FBEBuffer& _buffer;
    mutable size_t _offset;

public:
    FinalModel<FBE::uuid_t> id;
    FinalModel<std::string> error;
};

namespace proto {

// Fast Binary Encoding MessageReject final model
class MessageRejectFinalModel : public FBE::Model
{
public:
    MessageRejectFinalModel() : _model(this->buffer(), 8) {}
    MessageRejectFinalModel(const std::shared_ptr<FBEBuffer>& buffer) : FBE::Model(buffer), _model(this->buffer(), 8) {}

    // Get the model type
    static constexpr size_t fbe_type() noexcept { return FinalModel<::proto::MessageReject>::fbe_type(); }

    // Check if the struct value is valid
    bool verify();

    // Serialize the struct value
    size_t serialize(const ::proto::MessageReject& value);
    // Deserialize the struct value
    size_t deserialize(::proto::MessageReject& value) const noexcept;

    // Move to the next struct value
    void next(size_t prev) noexcept { _model.fbe_shift(prev); }

private:
    FinalModel<::proto::MessageReject> _model;
};

} // namespace proto

// Fast Binary Encoding ::proto::MessageNotify final model
template <>
class FinalModel<::proto::MessageNotify>
{
public:
    FinalModel(FBEBuffer& buffer, size_t offset) noexcept;

    // Get the allocation size
    size_t fbe_allocation_size(const ::proto::MessageNotify& fbe_value) const noexcept;
    // Get the final offset
    size_t fbe_offset() const noexcept { return _offset; }
    // Set the final offset
    size_t fbe_offset(size_t offset) const noexcept { return _offset = offset; }
    // Get the final type
    static constexpr size_t fbe_type() noexcept { return 3; }

    // Shift the current final offset
    void fbe_shift(size_t size) noexcept { _offset += size; }
    // Unshift the current final offset
    void fbe_unshift(size_t size) noexcept { _offset -= size; }

    // Check if the struct value is valid
    size_t verify() const noexcept;
    // Check if the struct fields are valid
    size_t verify_fields() const noexcept;

    // Get the struct value
    size_t get(::proto::MessageNotify& fbe_value) const noexcept;
    // Get the struct fields values
    size_t get_fields(::proto::MessageNotify& fbe_value) const noexcept;

    // Set the struct value
    size_t set(const ::proto::MessageNotify& fbe_value) noexcept;
    // Set the struct fields values
    size_t set_fields(const ::proto::MessageNotify& fbe_value) noexcept;

private:
    FBEBuffer& _buffer;
    mutable size_t _offset;

public:
    FinalModel<std::string> notification;
};

namespace proto {

// Fast Binary Encoding MessageNotify final model
class MessageNotifyFinalModel : public FBE::Model
{
public:
    MessageNotifyFinalModel() : _model(this->buffer(), 8) {}
    MessageNotifyFinalModel(const std::shared_ptr<FBEBuffer>& buffer) : FBE::Model(buffer), _model(this->buffer(), 8) {}

    // Get the model type
    static constexpr size_t fbe_type() noexcept { return FinalModel<::proto::MessageNotify>::fbe_type(); }

    // Check if the struct value is valid
    bool verify();

    // Serialize the struct value
    size_t serialize(const ::proto::MessageNotify& value);
    // Deserialize the struct value
    size_t deserialize(::proto::MessageNotify& value) const noexcept;

    // Move to the next struct value
    void next(size_t prev) noexcept { _model.fbe_shift(prev); }

private:
    FinalModel<::proto::MessageNotify> _model;
};

} // namespace proto

// Fast Binary Encoding ::proto::DisconnectRequest final model
template <>
class FinalModel<::proto::DisconnectRequest>
{
public:
    FinalModel(FBEBuffer& buffer, size_t offset) noexcept;

    // Get the allocation size
    size_t fbe_allocation_size(const ::proto::DisconnectRequest& fbe_value) const noexcept;
    // Get the final offset
    size_t fbe_offset() const noexcept { return _offset; }
    // Set the final offset
    size_t fbe_offset(size_t offset) const noexcept { return _offset = offset; }
    // Get the final type
    static constexpr size_t fbe_type() noexcept { return 4; }

    // Shift the current final offset
    void fbe_shift(size_t size) noexcept { _offset += size; }
    // Unshift the current final offset
    void fbe_unshift(size_t size) noexcept { _offset -= size; }

    // Check if the struct value is valid
    size_t verify() const noexcept;
    // Check if the struct fields are valid
    size_t verify_fields() const noexcept;

    // Get the struct value
    size_t get(::proto::DisconnectRequest& fbe_value) const noexcept;
    // Get the struct fields values
    size_t get_fields(::proto::DisconnectRequest& fbe_value) const noexcept;

    // Set the struct value
    size_t set(const ::proto::DisconnectRequest& fbe_value) noexcept;
    // Set the struct fields values
    size_t set_fields(const ::proto::DisconnectRequest& fbe_value) noexcept;

private:
    FBEBuffer& _buffer;
    mutable size_t _offset;

public:
    FinalModel<FBE::uuid_t> id;
};

namespace proto {

// Fast Binary Encoding DisconnectRequest final model
class DisconnectRequestFinalModel : public FBE::Model
{
public:
    DisconnectRequestFinalModel() : _model(this->buffer(), 8) {}
    DisconnectRequestFinalModel(const std::shared_ptr<FBEBuffer>& buffer) : FBE::Model(buffer), _model(this->buffer(), 8) {}

    // Get the model type
    static constexpr size_t fbe_type() noexcept { return FinalModel<::proto::DisconnectRequest>::fbe_type(); }

    // Check if the struct value is valid
    bool verify();

    // Serialize the struct value
    size_t serialize(const ::proto::DisconnectRequest& value);
    // Deserialize the struct value
    size_t deserialize(::proto::DisconnectRequest& value) const noexcept;

    // Move to the next struct value
    void next(size_t prev) noexcept { _model.fbe_shift(prev); }

private:
    FinalModel<::proto::DisconnectRequest> _model;
};

} // namespace proto

} // namespace FBE
