View Source SpeedrunClient.Embeddings (srex v0.1.0)
Most resources are related to others in some form. A run is related to the category it is done in, as well as the users that have executed it.
As resources are available as separate entities in the API, fetching a run including the information about its game and users involves making multiple requests (one for getting the run, then parsing it and then one more for the game etc.).
The speedrun.com API offers a way to reduce the amount of requests by embedding related resources right in the representation of others. This is done via the query string parameter embed
, which is a comma separated list of resources that should be embedded. Each resource documents what embeds are available for it.
Summary
Functions
Generates the valid set of embedding options provided a resource type and embedding depth.
Functions
Generates the valid set of embedding options provided a resource type and embedding depth.
Returns MapSet([:string])
## Examples
iex> SpeedrunClient.Embeddings.generate_valid_embeddings("runs")
MapSet.new(["game", "category", "level", "players", "region", "platform"])
iex> SpeedrunClient.Embeddings.generate_valid_embeddings("levels")
MapSet.new(["categories", "categories.game", "categories.variables", "variables"])