-- Code generated by protoc-gen-tarantool. DO NOT EDIT.
-- source: quickstart.proto
-- syntax: proto3
-- package: quickstart
local pb = require("pb")
local wire = pb.wire
local string_byte = string.byte
local band = bit.band
local rshift = bit.rshift
local M = {}
M.options = {go_package = "tarantoolpb_synthetic/quickstart"}
-- Enum: quickstart.Role
M.Role_descriptor = pb.enum("quickstart.Role", {
ROLE_UNSPECIFIED = 0,
USER = 1,
ADMIN = 2,
})
M.Role = M.Role_descriptor.by_name
-- Pre-declare message descriptors so cross-references resolve.
M.User_descriptor = {name = "quickstart.User"}
-- Message: quickstart.User
M.User_descriptor.fields = {
{name="id", id=1, kind='scalar', proto_type="int32"},
{name="name", id=2, kind='scalar', proto_type="string"},
{name="role", id=3, kind='enum', enum=M.Role_descriptor},
{name="emails", id=4, kind='scalar', proto_type="string", repeated=true},
}
pb.finalize_message(M.User_descriptor)
M.User_fields = pb.field_names({
id = "id",
name = "name",
role = "role",
emails = "emails",
})
-- EmmyLua / lua-language-server type annotations.
-- These are comments — no runtime effect. They give editors
-- autocomplete and type-checking for the generated wrappers.
---@alias quickstart.Role integer
---@class quickstart.User
---@field id integer
---@field name string
---@field role quickstart.Role
---@field emails string[]
---@param t? quickstart.User
---@return quickstart.User
function M.User_new(t) return t or {} end
---@param t quickstart.User
---@return string
function M.User_encode(t) return pb.encode(M.User_descriptor, t) end
---@param b string
---@return quickstart.User
function M.User_decode(b) return pb.decode(M.User_descriptor, b) end
---@param b string
---@return pb.MessageView
function M.User_decode_lazy(b) return pb.decode_lazy(M.User_descriptor, b) end
---@param t quickstart.User
---@param opts? {single_line: boolean?, indent: string?}
---@return string
function M.User_text(t, opts) return pb.text.encode(M.User_descriptor, t, opts) end
return M