spacetraders_api_httpc
Types
pub type HttpcApiError {
ClientError(httpc.HttpError)
JsonDecodeError(json.DecodeError)
ServerError(spacetraders_error.SpacetradersError)
}
Constructors
-
ClientError(httpc.HttpError)
-
JsonDecodeError(json.DecodeError)
-
ServerError(spacetraders_error.SpacetradersError)
pub type HttpcApiResponse(data) =
Result(data, HttpcApiError)
Values
pub fn accept_contract(
token: agent_token.AgentToken,
contract_id: contract_id.ContractId,
) -> Result(spacetraders_api.ContractAccepted, HttpcApiError)
pub fn create_chart(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(spacetraders_api.ChartCreated, HttpcApiError)
pub fn create_survey(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(spacetraders_api.SurveyCreated, HttpcApiError)
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 dock_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship_nav.ShipNav, HttpcApiError)
pub fn extract_resources(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(spacetraders_api.ResourcesExtracted, HttpcApiError)
pub fn extract_resources_with_survey(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
survey: survey.Survey,
) -> Result(spacetraders_api.ResourcesExtracted, HttpcApiError)
pub fn fulfill_contract(
token: agent_token.AgentToken,
contract_id: contract_id.ContractId,
) -> Result(spacetraders_api.ContractFulfilled, HttpcApiError)
pub fn get_account(
token: agent_token.AgentToken,
) -> Result(account.Account, 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_construction_site(
system_symbol: system_symbol.SystemSymbol,
waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(construction.Construction, HttpcApiError)
pub fn get_contract(
token: agent_token.AgentToken,
contract_id: contract_id.ContractId,
) -> Result(contract.Contract, HttpcApiError)
pub fn get_faction(
symbol: faction_symbol.FactionSymbol,
) -> Result(faction.Faction, 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_my_factions(
token: agent_token.AgentToken,
page: option.Option(Int),
limit: option.Option(Int),
) -> Result(
paged_data.PagedData(List(spacetraders_api.FactionReputation)),
HttpcApiError,
)
pub fn get_public_agent(
agent_symbol: agent_symbol.AgentSymbol,
) -> Result(public_agent.PublicAgent, HttpcApiError)
pub fn get_repair_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(repair_transaction.RepairTransaction, HttpcApiError)
pub fn get_scrap_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(scrap_transaction.ScrapTransaction, HttpcApiError)
pub fn get_server_status(
,
) -> Result(spacetraders_api.ServerStatus, HttpcApiError)
pub fn get_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship.Ship, HttpcApiError)
pub fn get_ship_cargo(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship_cargo.ShipCargo, HttpcApiError)
pub fn get_ship_cooldown(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(option.Option(cooldown.Cooldown), 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_ship_nav(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship_nav.ShipNav, HttpcApiError)
pub fn get_shipyard(
system_symbol: system_symbol.SystemSymbol,
waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(shipyard.Shipyard, HttpcApiError)
pub fn get_supply_chain(
,
) -> Result(
dict.Dict(
trade_symbol.TradeSymbol,
List(trade_symbol.TradeSymbol),
),
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 install_ship_module(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
module_symbol: module_symbol.ModuleSymbol,
) -> Result(spacetraders_api.ShipModuleInstalled, HttpcApiError)
pub fn install_ship_mount(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
mount_symbol: mount_symbol.MountSymbol,
) -> Result(spacetraders_api.ShipMountInstalled, 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 jump_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(spacetraders_api.ShipJumped, 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_system_waypoints(
system_symbol: system_symbol.SystemSymbol,
page: option.Option(Int),
limit: option.Option(Int),
type_: option.Option(waypoint_type.WaypointType),
traits: List(waypoint_trait_symbol.WaypointTraitSymbol),
) -> Result(
paged_data.PagedData(List(waypoint.Waypoint)),
HttpcApiError,
)
pub fn list_systems(
page: option.Option(Int),
limit: option.Option(Int),
) -> Result(
paged_data.PagedData(List(system.System)),
HttpcApiError,
)
pub fn navigate_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(spacetraders_api.ShipNavigated, HttpcApiError)
pub fn negotiate_contract(
token: agent_token.AgentToken,
ship_symbol: String,
) -> Result(contract.Contract, HttpcApiError)
pub fn orbit_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(ship_nav.ShipNav, HttpcApiError)
pub fn patch_ship_nav(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
flight_mode: ship_nav_flight_mode.ShipNavFlightMode,
) -> Result(spacetraders_api.ShipNavPatched, HttpcApiError)
pub fn purchase_cargo(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
trade_symbol: trade_symbol.TradeSymbol,
) -> Result(spacetraders_api.CargoPurchased, HttpcApiError)
pub fn purchase_ship(
token: agent_token.AgentToken,
ship_type: ship_type.ShipType,
waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(spacetraders_api.ShipPurchased, HttpcApiError)
pub fn refine_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
produce: refinement_produce.RefinementProduce,
) -> Result(spacetraders_api.ShipRefined, 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 register_new_agent(
token: account_token.AccountToken,
agent_symbol: agent_symbol.AgentSymbol,
faction_symbol: faction_symbol.FactionSymbol,
) -> Result(spacetraders_api.AgentRegistered, HttpcApiError)
pub fn remove_ship_module(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
module_symbol: module_symbol.ModuleSymbol,
) -> Result(spacetraders_api.ShipModuleRemoved, HttpcApiError)
pub fn remove_ship_mount(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
mount_symbol: mount_symbol.MountSymbol,
) -> Result(spacetraders_api.ShipMountRemoved, HttpcApiError)
pub fn repair_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(spacetraders_api.ShipRepaired, HttpcApiError)
pub fn scan_ships(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(
spacetraders_api.Scan(scanned_ship.ScannedShip),
HttpcApiError,
)
pub fn scan_systems(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(
spacetraders_api.Scan(scanned_system.ScannedSystem),
HttpcApiError,
)
pub fn scan_waypoints(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(
spacetraders_api.Scan(scanned_waypoint.ScannedWaypoint),
HttpcApiError,
)
pub fn scrap_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(spacetraders_api.ShipScrapped, 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 siphon_resources(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
) -> Result(spacetraders_api.ResourcesSiphoned, HttpcApiError)
pub fn supply_construction_site(
token: agent_token.AgentToken,
system_symbol: system_symbol.SystemSymbol,
waypoint_symbol: waypoint_symbol.WaypointSymbol,
ship_symbol: ship_symbol.ShipSymbol,
trade_symbol: trade_symbol.TradeSymbol,
units: Int,
) -> Result(
spacetraders_api.ConstructionSiteSupplied,
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)
pub fn warp_ship(
token: agent_token.AgentToken,
ship_symbol: ship_symbol.ShipSymbol,
waypoint_symbol: waypoint_symbol.WaypointSymbol,
) -> Result(spacetraders_api.ShipWarped, HttpcApiError)