#[derive(Debug, Clone)]
pub struct ResponseContent<T> {
pub status: reqwest::StatusCode,
pub response_body: String,
pub content: T,
}
#[derive(thiserror::Error, Debug)]
pub enum Error<T> {
#[error("error performing request: {0}")]
Reqwest(#[from] reqwest::Error),
#[error("error deserializing: {0}")]
Serde(#[from] serde_json::Error),
#[error("got error response: {} - {}", .0.status, .0.response_body)]
ResponseError(ResponseContent<T>),
#[error("got unknown response: {status} - {response_body}")]
UnknownResponse {
is_error: bool,
status: reqwest::StatusCode,
response_body: String,
},
}
fn urlencode<T: AsRef<str>>(s: T) -> String {
::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect()
}
pub mod agents_api;
pub mod contracts_api;
pub mod default_api;
pub mod factions_api;
pub mod fleet_api;
pub mod systems_api;
mod configuration;
pub use configuration::*;