View Source PropOddsAPI.Api.Games (PropOddsApi v0.0.2)
This module provides functionality to interact with game data from the PropOdds API.
Summary
Functions
Retrieves information for a specific game by its ID.
Fetches games information for a specific league and date.
Functions
@spec get_game(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, PropOddsAPI.Model.GameInfo.t()} | {:ok, PropOddsAPI.Model.HttpValidationError.t()} | {:error, Tesla.Env.t()}
Retrieves information for a specific game by its ID.
Parameters
connection: TheTesla.Env.client()used to make the HTTP request.game_id: The unique identifier for the game, as aString.t().api_key: The API key used for authorization, as aString.t().opts: Optional parameters provided as a keyword list (currently unused).
Returns
{:ok, PropOddsAPI.Model.GameInfo.t()}: On success, returns the game information.{:ok, PropOddsAPI.Model.HttpValidationError.t()}: If there's a validation error with the HTTP request.{:error, Tesla.Env.t()}: On failure, returns the error within the Tesla environment.
@spec get_games(Tesla.Env.client(), String.t(), String.t(), Date.t(), keyword()) :: {:ok, PropOddsAPI.Model.HttpValidationError.t()} | {:ok, PropOddsAPI.Model.GamesInfo.t()} | {:error, Tesla.Env.t()}
Fetches games information for a specific league and date.
Parameters
connection: TheTesla.Env.client()used to make the HTTP request.league: The league identifier, as aString.t().api_key: The API key used for authorization, as aString.t().date: The date for which games information is requested, as aDate.t().opts: Optional parameters provided as a keyword list, which may include timezone (:tz).
Returns
{:ok, PropOddsAPI.Model.GamesInfo.t()}: On success, returns the games information.{:ok, PropOddsAPI.Model.HttpValidationError.t()}: If there's a validation error with the HTTP request.{:error, Tesla.Env.t()}: On failure, returns the error within the Tesla environment.