spacetraders_api_httpc

Types

pub type HttpcApiError {
  ClientError(httpc.HttpError)
  JsonDecodeError(json.DecodeError)
  ServerError(spacetraders_error.SpacetradersError)
}

Constructors

pub type HttpcApiResponse(data) =
  Result(data, HttpcApiError)

Values

pub fn deliver_contract_cargo(
  token: agent_token.AgentToken,
  contract_id: contract_id.ContractId,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
) -> Result(
  spacetraders_api.ContractCargoDelivered,
  HttpcApiError,
)
pub fn get_agent(
  token: agent_token.AgentToken,
) -> Result(agent.Agent, HttpcApiError)
pub fn get_agent_events(
  token: agent_token.AgentToken,
) -> Result(List(agent_event.AgentEvent), HttpcApiError)
pub fn get_jump_gate(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(jump_gate.JumpGate, HttpcApiError)
pub fn get_market(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(market.Market, HttpcApiError)
pub fn get_public_agent(
  agent_symbol: agent_symbol.AgentSymbol,
) -> Result(public_agent.PublicAgent, HttpcApiError)
pub fn get_ship(
  token: agent_token.AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship.Ship, HttpcApiError)
pub fn get_ship_modules(
  token: agent_token.AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(List(ship_module.ShipModule), HttpcApiError)
pub fn get_ship_mounts(
  token: agent_token.AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
) -> Result(List(ship_mount.ShipMount), HttpcApiError)
pub fn get_shipyard(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(shipyard.Shipyard, HttpcApiError)
pub fn get_system(
  system_symbol: system_symbol.SystemSymbol,
) -> Result(system.System, HttpcApiError)
pub fn get_waypoint(
  system_symbol: system_symbol.SystemSymbol,
  waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(waypoint.Waypoint, HttpcApiError)
pub fn jettison_cargo(
  token: agent_token.AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
) -> Result(ship_cargo.ShipCargo, HttpcApiError)
pub fn list_contracts(
  token: agent_token.AgentToken,
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  paged_data.PagedData(List(contract.Contract)),
  HttpcApiError,
)
pub fn list_error_codes(
  ,
) -> Result(List(spacetraders_api.ErrorCode), HttpcApiError)
pub fn list_factions(
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  paged_data.PagedData(List(faction.Faction)),
  HttpcApiError,
)
pub fn list_public_agents(
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  paged_data.PagedData(List(public_agent.PublicAgent)),
  HttpcApiError,
)
pub fn list_ships(
  token: agent_token.AgentToken,
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(paged_data.PagedData(List(ship.Ship)), HttpcApiError)
pub fn list_systems(
  page: option.Option(Int),
  limit: option.Option(Int),
) -> Result(
  paged_data.PagedData(List(system.System)),
  HttpcApiError,
)
pub fn negotiate_contract(
  token: agent_token.AgentToken,
  ship_symbol: String,
) -> Result(contract.Contract, HttpcApiError)
pub fn refuel_ship(
  token: agent_token.AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  units: option.Option(Int),
  from_cargo: option.Option(Bool),
) -> Result(spacetraders_api.ShipRefueled, HttpcApiError)
pub fn sell_cargo(
  token: agent_token.AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
) -> Result(spacetraders_api.CargoSold, HttpcApiError)
pub fn transfer_cargo(
  token: agent_token.AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
  target_ship_symbol: ship_symbol.ShipSymbol,
) -> Result(spacetraders_api.CargoTransferred, HttpcApiError)
Search Document