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 |
5 |
input(<<"SubAction">>, <<"INVITE">>) -> {ok, invite}; |
21 |
2 |
input(<<"SubAction">>, <<"ACCEPT">>) -> {ok, accept}; |
22 |
2 |
input(<<"SubAction">>, <<"DECLINE">>) -> {ok, decline}; |
23 |
2 |
input(<<"SubAction">>, <<"CANCEL">>) -> {ok, cancel}; |
24 |
2 |
input(<<"MutualSubAction">>, <<"CONNECT">>) -> {ok, connect}; |
25 |
2 |
input(<<"MutualSubAction">>, <<"DISCONNECT">>) -> {ok, disconnect}. |
26 |
|
|
27 |
|
output(<<"PresenceShow">>, Show) -> |
28 |
:-( |
{ok, list_to_binary(string:to_upper(binary_to_list(Show)))}; |
29 |
|
output(<<"PresenceType">>, Type) -> |
30 |
:-( |
{ok, list_to_binary(string:to_upper(binary_to_list(Type)))}; |
31 |
|
output(<<"AuthStatus">>, Status) -> |
32 |
5 |
{ok, atom_to_binary(Status, utf8)}; |
33 |
|
output(<<"Affiliation">>, Aff) -> |
34 |
12 |
{ok, list_to_binary(string:to_upper(atom_to_list(Aff)))}; |
35 |
|
output(<<"BlockingAction">>, Action) -> |
36 |
3 |
{ok, list_to_binary(string:to_upper(atom_to_list(Action)))}; |
37 |
|
output(<<"BlockedEntityType">>, What) -> |
38 |
3 |
{ok, list_to_binary(string:to_upper(atom_to_list(What)))}; |
39 |
|
output(<<"ContactSub">>, Type) when Type =:= both; |
40 |
|
Type =:= from; |
41 |
|
Type =:= to; |
42 |
|
Type =:= none -> |
43 |
4 |
{ok, list_to_binary(string:to_upper(atom_to_list(Type)))}; |
44 |
|
output(<<"ContactAsk">>, Type) when Type =:= subscrube; |
45 |
|
Type =:= unsubscribe; |
46 |
|
Type =:= in; |
47 |
|
Type =:= out; |
48 |
|
Type =:= both; |
49 |
|
Type =:= none -> |
50 |
4 |
{ok, list_to_binary(string:to_upper(atom_to_list(Type)))}. |