{- !!! DO NOT EDIT THIS FILE MANUALLY !!! -} module Proto.Test.Role exposing (Role(..), decodeRole, defaultRole, encodeRole, fieldNumbersRole) {-| This file was automatically generated by - [`protoc-gen-elm`](https://www.npmjs.com/package/protoc-gen-elm) 4.0.3 - `protoc` 4.25.3 - the following specification files: `test_resources/test.proto` To run it, add a dependency via `elm install` on [`elm-protocol-buffers`](https://package.elm-lang.org/packages/eriktim/elm-protocol-buffers/1.2.0) version latest or higher. @docs Role, decodeRole, defaultRole, encodeRole, fieldNumbersRole -} import Protobuf.Decode import Protobuf.Encode {-| The field numbers for the fields of `Role`. This is mostly useful for internals, like documentation generation. -} fieldNumbersRole : Role -> Int fieldNumbersRole n_ = case n_ of ReadFeatureFoo -> 0 WriteFeatureFoo -> 1 ReadFeatureBar -> 2 WriteFeatureBar -> 3 RoleUnrecognized_ m_ -> m_ {-| Default for Role. Should only be used for 'required' decoders as an initial value. -} defaultRole : Role defaultRole = ReadFeatureFoo {-| Declares how to encode a `Role` to Bytes. To actually perform the conversion to Bytes, you need to use Protobuf.Encode.encode from eriktim/elm-protocol-buffers. -} encodeRole : Role -> Protobuf.Encode.Encoder encodeRole value = Protobuf.Encode.int32 <| case value of ReadFeatureFoo -> 0 WriteFeatureFoo -> 1 ReadFeatureBar -> 2 WriteFeatureBar -> 3 RoleUnrecognized_ i -> i {-| Declares how to decode a `Role` from Bytes. To actually perform the conversion from Bytes, you need to use Protobuf.Decode.decode from eriktim/elm-protocol-buffers. -} decodeRole : Protobuf.Decode.Decoder Role decodeRole = Protobuf.Decode.int32 |> Protobuf.Decode.map (\i -> case i of 0 -> ReadFeatureFoo 1 -> WriteFeatureFoo 2 -> ReadFeatureBar 3 -> WriteFeatureBar _ -> RoleUnrecognized_ i ) {-| `Role` enumeration -} type Role = ReadFeatureFoo | WriteFeatureFoo | ReadFeatureBar | WriteFeatureBar | RoleUnrecognized_ Int