spacetraders_api_fetch

Types

pub type FetchApiError {
  ClientError(fetch.FetchError)
  JsonDecodeError(json.DecodeError)
  ServerError(spacetraders_error.SpacetradersError)
}

Constructors

pub type FetchApiResponse(data) =
  promise.Promise(Result(data, FetchApiError))

Values

pub fn jettison_cargo(
  token: agent_token.AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  trade_symbol: trade_symbol.TradeSymbol,
  units: Int,
) -> promise.Promise(Result(ship_cargo.ShipCargo, FetchApiError))
pub fn list_contracts(
  token: agent_token.AgentToken,
  page: option.Option(Int),
  limit: option.Option(Int),
) -> promise.Promise(
  Result(
    paged_data.PagedData(List(contract.Contract)),
    FetchApiError,
  ),
)
pub fn list_error_codes(
  ,
) -> promise.Promise(
  Result(List(spacetraders_api.ErrorCode), FetchApiError),
)
pub fn list_factions(
  page: option.Option(Int),
  limit: option.Option(Int),
) -> promise.Promise(
  Result(
    paged_data.PagedData(List(faction.Faction)),
    FetchApiError,
  ),
)
pub fn list_public_agents(
  page: option.Option(Int),
  limit: option.Option(Int),
) -> promise.Promise(
  Result(
    paged_data.PagedData(List(public_agent.PublicAgent)),
    FetchApiError,
  ),
)
pub fn list_ships(
  token: agent_token.AgentToken,
  page: option.Option(Int),
  limit: option.Option(Int),
) -> promise.Promise(
  Result(paged_data.PagedData(List(ship.Ship)), FetchApiError),
)
pub fn list_systems(
  page: option.Option(Int),
  limit: option.Option(Int),
) -> promise.Promise(
  Result(paged_data.PagedData(List(system.System)), FetchApiError),
)
pub fn negotiate_contract(
  token: agent_token.AgentToken,
  ship_symbol: String,
) -> promise.Promise(Result(contract.Contract, FetchApiError))
pub fn refuel_ship(
  token: agent_token.AgentToken,
  ship_symbol: ship_symbol.ShipSymbol,
  units: option.Option(Int),
  from_cargo: option.Option(Bool),
) -> promise.Promise(
  Result(spacetraders_api.ShipRefueled, FetchApiError),
)
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,
) -> promise.Promise(
  Result(spacetraders_api.CargoTransferred, FetchApiError),
)
Search Document