1 |
|
-module(mongoose_graphql_enum). |
2 |
|
|
3 |
|
-export([input/2, output/2]). |
4 |
|
|
5 |
|
-ignore_xref([input/2, output/2]). |
6 |
|
|
7 |
|
input(<<"PresenceShow">>, Show) -> |
8 |
3 |
{ok, list_to_binary(string:to_lower(binary_to_list(Show)))}; |
9 |
|
input(<<"PresenceType">>, Type) -> |
10 |
4 |
{ok, list_to_binary(string:to_lower(binary_to_list(Type)))}; |
11 |
:-( |
input(<<"AuthStatus">>, <<"AUTHORIZED">>) -> {ok, 'AUTHORIZED'}; |
12 |
:-( |
input(<<"AuthStatus">>, <<"UNAUTHORIZED">>) -> {ok, 'UNAUTHORIZED'}; |
13 |
:-( |
input(<<"Affiliation">>, <<"OWNER">>) -> {ok, owner}; |
14 |
:-( |
input(<<"Affiliation">>, <<"MEMBER">>) -> {ok, member}; |
15 |
:-( |
input(<<"Affiliation">>, <<"NONE">>) -> {ok, none}; |
16 |
2 |
input(<<"BlockingAction">>, <<"ALLOW">>) -> {ok, allow}; |
17 |
3 |
input(<<"BlockingAction">>, <<"DENY">>) -> {ok, deny}; |
18 |
4 |
input(<<"BlockedEntityType">>, <<"USER">>) -> {ok, user}; |
19 |
1 |
input(<<"BlockedEntityType">>, <<"ROOM">>) -> {ok, room}. |
20 |
|
|
21 |
|
output(<<"PresenceShow">>, Show) -> |
22 |
:-( |
{ok, list_to_binary(string:to_upper(binary_to_list(Show)))}; |
23 |
|
output(<<"PresenceType">>, Type) -> |
24 |
:-( |
{ok, list_to_binary(string:to_upper(binary_to_list(Type)))}; |
25 |
|
output(<<"AuthStatus">>, Status) -> |
26 |
5 |
{ok, atom_to_binary(Status, utf8)}; |
27 |
|
output(<<"Affiliation">>, Aff) -> |
28 |
12 |
{ok, list_to_binary(string:to_upper(atom_to_list(Aff)))}; |
29 |
|
output(<<"BlockingAction">>, Action) -> |
30 |
3 |
{ok, list_to_binary(string:to_upper(atom_to_list(Action)))}; |
31 |
|
output(<<"BlockedEntityType">>, What) -> |
32 |
3 |
{ok, list_to_binary(string:to_upper(atom_to_list(What)))}. |