Cyphi.Games (Cyphi v0.1.0)
Provides API endpoints related to games
Summary
Functions
Get game
List games
List levels
List players
List player's badge history
List player's level history
List player's point history
Types
@type game_crud_get_400_json_resp() :: %{message: String.t() | nil}
@type game_crud_get_403_json_resp() :: %{message: String.t() | nil}
@type game_crud_get_404_json_resp() :: %{message: String.t() | nil}
@type game_crud_get_405_json_resp() :: %{message: String.t() | nil}
@type game_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type game_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type game_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type game_crud_list_405_json_resp() :: %{message: String.t() | nil}
@type game_level_crud_get_400_json_resp() :: %{message: String.t() | nil}
@type game_level_crud_get_403_json_resp() :: %{message: String.t() | nil}
@type game_level_crud_get_404_json_resp() :: %{message: String.t() | nil}
@type game_level_crud_get_405_json_resp() :: %{message: String.t() | nil}
@type game_level_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type game_level_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type game_level_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type game_level_crud_list_405_json_resp() :: %{message: String.t() | nil}
@type game_player_crud_get_400_json_resp() :: %{message: String.t() | nil}
@type game_player_crud_get_403_json_resp() :: %{message: String.t() | nil}
@type game_player_crud_get_404_json_resp() :: %{message: String.t() | nil}
@type game_player_crud_get_405_json_resp() :: %{message: String.t() | nil}
@type game_player_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type game_player_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type game_player_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type game_player_crud_list_405_json_resp() :: %{message: String.t() | nil}
@type player_badge_history_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type player_badge_history_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type player_badge_history_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type player_badge_history_crud_list_405_json_resp() :: %{message: String.t() | nil}
@type player_level_history_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type player_level_history_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type player_level_history_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type player_level_history_crud_list_405_json_resp() :: %{message: String.t() | nil}
@type player_point_history_crud_list_400_json_resp() :: %{message: String.t() | nil}
@type player_point_history_crud_list_403_json_resp() :: %{message: String.t() | nil}
@type player_point_history_crud_list_404_json_resp() :: %{message: String.t() | nil}
@type player_point_history_crud_list_405_json_resp() :: %{message: String.t() | nil}
Functions
@spec game_crud_get(id :: integer(), opts :: keyword()) :: {:ok, Cyphi.Game.t()} | {:error, game_crud_get_400_json_resp() | game_crud_get_403_json_resp() | game_crud_get_404_json_resp() | game_crud_get_405_json_resp()}
Get game
Return the game with the specified ID.
@spec game_crud_list(opts :: keyword()) :: {:ok, [Cyphi.Game.t()]} | {:error, game_crud_list_400_json_resp() | game_crud_list_403_json_resp() | game_crud_list_404_json_resp() | game_crud_list_405_json_resp()}
List games
Return a list of games. You can provide one or more optional filters. Currently this operation only returns games that are site-wide; future versions may include a way to specify the scope such as games for courses.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: id, name.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.$order: Comma separated attribute names to sort by, taken from this list: id, name. Add :desc to the end of an attribute name for descending order. This cannot be used with the $after parameter.
@spec game_level_crud_get(id :: integer(), level_id :: integer(), opts :: keyword()) :: {:ok, Cyphi.Level.t()} | {:error, game_level_crud_get_400_json_resp() | game_level_crud_get_403_json_resp() | game_level_crud_get_404_json_resp() | game_level_crud_get_405_json_resp()}
Get level
Return the game level with the specified ID.
@spec game_level_crud_list(id :: integer(), opts :: keyword()) :: {:ok, [Cyphi.Level.t()]} | {:error, game_level_crud_list_400_json_resp() | game_level_crud_list_403_json_resp() | game_level_crud_list_404_json_resp() | game_level_crud_list_405_json_resp()}
List levels
Return a list of game levels.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: id, name.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.
@spec game_player_crud_get(id :: integer(), user_id :: integer(), opts :: keyword()) :: {:ok, Cyphi.Player.t()} | {:error, game_player_crud_get_400_json_resp() | game_player_crud_get_403_json_resp() | game_player_crud_get_404_json_resp() | game_player_crud_get_405_json_resp()}
Get player
Return the player with the specified ID. Note that this does not return a user object, it returns a player record that include the user_id. You can use $include=user if you want to get the user object as well.
Note that the points field indicates the total number of points that the player currently has and their current level. There are additional methods for getting the history of the player's points, badges, and level achievements.
Options
$include: Comma separated list of relationships to include in the results, taken from this list: user.
@spec game_player_crud_list(id :: integer(), opts :: keyword()) :: {:ok, [Cyphi.Player.t()]} | {:error, game_player_crud_list_400_json_resp() | game_player_crud_list_403_json_resp() | game_player_crud_list_404_json_resp() | game_player_crud_list_405_json_resp()}
List players
Return a list of the players in the game with the specified ID. Note that this does not return user objects, it returns their player records that include the user_id. You can use $include=user if you want to get the user object as well.
Note also that the points field indicates the total number of points that the player currently has and their current level. There are additional methods for getting the history of the player's points, badges, and level achievements.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: user_id, id, id, name.$include: Comma separated list of relationships to include in the results, taken from this list: user.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.
@spec player_badge_history_crud_list( id :: integer(), user_id :: integer(), opts :: keyword() ) :: {:ok, [Cyphi.BadgeHistory.t()]} | {:error, player_badge_history_crud_list_400_json_resp() | player_badge_history_crud_list_403_json_resp() | player_badge_history_crud_list_404_json_resp() | player_badge_history_crud_list_405_json_resp()}
List player's badge history
Return a list of the specified player's badge history.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: id.$include: Comma separated list of relationships to include in the results, taken from this list: badge.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.
@spec player_level_history_crud_list( id :: integer(), user_id :: integer(), opts :: keyword() ) :: {:ok, [Cyphi.LevelHistory.t()]} | {:error, player_level_history_crud_list_400_json_resp() | player_level_history_crud_list_403_json_resp() | player_level_history_crud_list_404_json_resp() | player_level_history_crud_list_405_json_resp()}
List player's level history
Return a list of the specified player's level history.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: id.$include: Comma separated list of relationships to include in the results, taken from this list: level.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.
@spec player_point_history_crud_list( id :: integer(), user_id :: integer(), opts :: keyword() ) :: {:ok, [Cyphi.PointHistory.t()]} | {:error, player_point_history_crud_list_400_json_resp() | player_point_history_crud_list_403_json_resp() | player_point_history_crud_list_404_json_resp() | player_point_history_crud_list_405_json_resp()}
List player's point history
Return a list of the specified player's point history.
Options
$after: Used for fast paging by setting the value to the last object id. This cannot be used with the $order parameter.$count: If true, just return the number of list items in the form {'count' : number}.$filter: Filter using JSON structure, with attributes taken from this list: id.$limit: Limit the number of returned objects. The default is 10, the maximum is 100.$offset: Used for paging through a small dataset, and it can be used with the $order parameter. This cannot be used with the $after parameter.