# ProtoBuf Enum - NamedTuple or Base.Enums.Enum type?

**URL:** https://discourse.julialang.org/t/protobuf-enum-namedtuple-or-base-enums-enum-type/80285
**Category:** General Usage
**Tags:** question, enum
**Created:** [April 30, 2022, 4:57am UTC](https://discourse.julialang.org/t/protobuf-enum-namedtuple-or-base-enums-enum-type/80285 "2022-04-30T04:57:18Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![FireCrumb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/firecrumb/32/35370_2.png) [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)
#### Post date: [May 11, 2022, 4:31am UTC](https://discourse.julialang.org/t/protobuf-enum-namedtuple-or-base-enums-enum-type/80285/2 "2022-05-11T04:31:52Z")

</div>

Converted from one to another:

> [@Call @enumx macro with NamedTuple constant as input](https://discourse.julialang.org/t/call-enumx-macro-with-namedtuple-constant-as-input/80699):
>
> Hi, I have a [NamedTuple](https://github.com/JuliaIO/ProtoBuf.jl/blob/v0.11.5/test/testcodec.jl#L286) and would like to create an [EnumX](https://discourse.julialang.org/t/ann-enumx-jl-improved-enums-for-julia/78096) from it, how can this be done? CC @fredrikekre Specifically, I’m using [ProtoBuf.il](https://github.com/JuliaIO/ProtoBuf.jl) to load an [enum from Protocol Buffers](https://developers.google.com/protocol-buffers/docs/proto#enum). And I want to create a new type using [@enumx macro](https://github.com/fredrikekre/EnumX.jl), where the input to the macro would be the NamedTuple key-value pairs as arguments. Input: const SrcProtoBufEnum = (;[ Symbol("UNIVERSAL") =\> Int32(0), Symbol("WEB") =\> Int32(1), Symbol("IMAGES") =\> Int32(2), Symbol("LOCAL") =\> Int32(3), Symbo…

---

_[View the full topic](https://discourse.julialang.org/t/protobuf-enum-namedtuple-or-base-enums-enum-type/80285)._
