Current section

Files

Jump to
tallgrass src tallgrass@move@learn_method.erl
Raw

src/tallgrass@move@learn_method.erl

-module(tallgrass@move@learn_method).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([new/0, fetch_resource/2, fetch/1, fetch_by_id/2, fetch_by_name/2]).
-export_type([move_learn_method/0]).
-type move_learn_method() :: {move_learn_method,
integer(),
binary(),
list(tallgrass@common@description:description()),
list(tallgrass@common@name:name()),
list(tallgrass@common@resource:resource())}.
-file("/Users/stevetoro/Code/tallgrass/src/tallgrass/move/learn_method.gleam", 21).
-spec new() -> tallgrass@client:client().
new() ->
tallgrass@client:new().
-file("/Users/stevetoro/Code/tallgrass/src/tallgrass/move/learn_method.gleam", 72).
-spec move_learn_method() -> decode:decoder(move_learn_method()).
move_learn_method() ->
_pipe = decode:into(
(decode:parameter(
fun(Id) ->
decode:parameter(
fun(Name) ->
decode:parameter(
fun(Descriptions) ->
decode:parameter(
fun(Names) ->
decode:parameter(
fun(Version_groups) ->
{move_learn_method,
Id,
Name,
Descriptions,
Names,
Version_groups}
end
)
end
)
end
)
end
)
end
))
),
_pipe@1 = decode:field(
_pipe,
<<"id"/utf8>>,
{decoder, fun gleam@dynamic:int/1}
),
_pipe@2 = decode:field(
_pipe@1,
<<"name"/utf8>>,
{decoder, fun gleam@dynamic:string/1}
),
_pipe@3 = decode:field(
_pipe@2,
<<"descriptions"/utf8>>,
decode:list(tallgrass@common@description:description())
),
_pipe@4 = decode:field(
_pipe@3,
<<"names"/utf8>>,
decode:list(tallgrass@common@name:name())
),
decode:field(
_pipe@4,
<<"version_groups"/utf8>>,
decode:list(tallgrass@common@resource:resource())
).
-file("/Users/stevetoro/Code/tallgrass/src/tallgrass/move/learn_method.gleam", 46).
-spec fetch_resource(
tallgrass@client:client(),
tallgrass@common@resource:resource()
) -> {ok, move_learn_method()} | {error, tallgrass@client@request:error()}.
fetch_resource(Client, Resource) ->
tallgrass@client:fetch_resource(Client, Resource, move_learn_method()).
-file("/Users/stevetoro/Code/tallgrass/src/tallgrass/move/learn_method.gleam", 32).
-spec fetch(tallgrass@client:client()) -> {ok,
tallgrass@common@resource:paginated_resource()} |
{error, tallgrass@client@request:error()}.
fetch(Client) ->
tallgrass@client:fetch_resources(Client, <<"move-learn-method"/utf8>>).
-file("/Users/stevetoro/Code/tallgrass/src/tallgrass/move/learn_method.gleam", 57).
-spec fetch_by_id(tallgrass@client:client(), integer()) -> {ok,
move_learn_method()} |
{error, tallgrass@client@request:error()}.
fetch_by_id(Client, Id) ->
tallgrass@client:fetch_by_id(
Client,
<<"move-learn-method"/utf8>>,
Id,
move_learn_method()
).
-file("/Users/stevetoro/Code/tallgrass/src/tallgrass/move/learn_method.gleam", 68).
-spec fetch_by_name(tallgrass@client:client(), binary()) -> {ok,
move_learn_method()} |
{error, tallgrass@client@request:error()}.
fetch_by_name(Client, Name) ->
tallgrass@client:fetch_by_name(
Client,
<<"move-learn-method"/utf8>>,
Name,
move_learn_method()
).