erlang-client.model.mustache Maven / Gradle / Ivy
{{#models}}
{{#model}}
-module({{classname}}).
-export([encode/1]).
-export_type([{{classname}}/0]).
-type {{classname}}() ::
#{ {{#vars}}'{{name}}' {{#required}}:={{/required}}{{^required}}=>{{/required}} {{{dataType}}}{{#hasMore}},
{{/hasMore}}{{/vars}}
}.
encode(#{ {{#vars}}'{{name}}' := {{{nameInCamelCase}}}{{#hasMore}},
{{/hasMore}}{{/vars}}
}) ->
#{ {{#vars}}'{{baseName}}' => {{{nameInCamelCase}}}{{#hasMore}},
{{/hasMore}}{{/vars}}
}.
{{/model}}
{{/models}}