Current section
Files
Jump to
Current section
Files
src/tallgrass@internal@evolution@evolution_trigger@client.erl
-module(tallgrass@internal@evolution@evolution_trigger@client).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]).
-export([fetch_by_name/1, fetch_by_id/1]).
-spec fetch_by_name(binary()) -> {ok,
tallgrass@internal@evolution@evolution_trigger@evolution_trigger:evolution_trigger()} |
{error, tallgrass@internal@http@error:error()}.
fetch_by_name(Name) ->
gleam@result:'try'(
tallgrass@internal@http@request:get(
{some, Name},
<<"evolution-trigger"/utf8>>
),
fun(Response) ->
tallgrass@internal@http@response:decode(
Response,
tallgrass@internal@evolution@evolution_trigger@evolution_trigger:evolution_trigger(
)
)
end
).
-spec fetch_by_id(integer()) -> {ok,
tallgrass@internal@evolution@evolution_trigger@evolution_trigger:evolution_trigger()} |
{error, tallgrass@internal@http@error:error()}.
fetch_by_id(Id) ->
gleam@result:'try'(
tallgrass@internal@http@request:get(
{some,
begin
_pipe = Id,
gleam@int:to_string(_pipe)
end},
<<"evolution-trigger"/utf8>>
),
fun(Response) ->
tallgrass@internal@http@response:decode(
Response,
tallgrass@internal@evolution@evolution_trigger@evolution_trigger:evolution_trigger(
)
)
end
).