-module(tallgrass@evolution@trigger). -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([evolution_trigger/0]). -type evolution_trigger() :: {evolution_trigger, integer(), binary(), list(tallgrass@common@name:name()), list(tallgrass@common@resource:resource())}. -file("/Users/stevetoro/Code/tallgrass/src/tallgrass/evolution/trigger.gleam", 19). -spec new() -> tallgrass@client:client(). new() -> tallgrass@client:new(). -file("/Users/stevetoro/Code/tallgrass/src/tallgrass/evolution/trigger.gleam", 70). -spec evolution_trigger() -> decode:decoder(evolution_trigger()). evolution_trigger() -> _pipe = decode:into( (decode:parameter( fun(Id) -> decode:parameter( fun(Name) -> decode:parameter( fun(Names) -> decode:parameter( fun(Pokemon_species) -> {evolution_trigger, Id, Name, Names, Pokemon_species} 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, <<"names"/utf8>>, decode:list(tallgrass@common@name:name()) ), decode:field( _pipe@3, <<"pokemon_species"/utf8>>, decode:list(tallgrass@common@resource:resource()) ). -file("/Users/stevetoro/Code/tallgrass/src/tallgrass/evolution/trigger.gleam", 44). -spec fetch_resource( tallgrass@client:client(), tallgrass@common@resource:resource() ) -> {ok, evolution_trigger()} | {error, tallgrass@client@request:error()}. fetch_resource(Client, Resource) -> tallgrass@client:fetch_resource(Client, Resource, evolution_trigger()). -file("/Users/stevetoro/Code/tallgrass/src/tallgrass/evolution/trigger.gleam", 30). -spec fetch(tallgrass@client:client()) -> {ok, tallgrass@common@resource:paginated_resource()} | {error, tallgrass@client@request:error()}. fetch(Client) -> tallgrass@client:fetch_resources(Client, <<"evolution-trigger"/utf8>>). -file("/Users/stevetoro/Code/tallgrass/src/tallgrass/evolution/trigger.gleam", 55). -spec fetch_by_id(tallgrass@client:client(), integer()) -> {ok, evolution_trigger()} | {error, tallgrass@client@request:error()}. fetch_by_id(Client, Id) -> tallgrass@client:fetch_by_id( Client, <<"evolution-trigger"/utf8>>, Id, evolution_trigger() ). -file("/Users/stevetoro/Code/tallgrass/src/tallgrass/evolution/trigger.gleam", 66). -spec fetch_by_name(tallgrass@client:client(), binary()) -> {ok, evolution_trigger()} | {error, tallgrass@client@request:error()}. fetch_by_name(Client, Name) -> tallgrass@client:fetch_by_name( Client, <<"evolution-trigger"/utf8>>, Name, evolution_trigger() ).