diff --git a/README.md b/README.md index e5e9c01..da59db7 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,15 @@ An asynchronous Rust wrapper for the omg.lol API by [Gil](https://gil.lol). LICENSE: MPL 2.0 (see [`LICENSE`](/LICENSE)) -> **Warning**: **This is a work in progress** +> **Warning**: **Heads up! This is a public alpha for adventurous folks!** > -> Unstable and bug-prone. Endpoints may change. Upstream endpoints under development. +> Keep in mind: +> All basic features should be implemented and functional +> Not all features have been throughly tested +> Endpoints are bound to change +> Bugs and unresolved issues are bound to come up +> This is available as-is and with no support or warranty +> Upstream endpoints are bound to change and will break this crate ## Contribute diff --git a/src/client.rs b/src/client.rs index 0a94db9..ae804a9 100644 --- a/src/client.rs +++ b/src/client.rs @@ -31,7 +31,6 @@ pub(crate) use api_endpoint; pub struct Auth; pub struct NoAuth; - /// Client for api.omg.lol #[derive(Clone)] pub struct OmglolClient { @@ -385,11 +384,10 @@ impl OmglolClient { } impl OmglolClient { - /// Create an authenticated `OmglolClient`. /// /// This client is able to access private endpoints. - /// + /// /// Example: /// ```rust /// let client = OmglolClient::new() @@ -530,7 +528,6 @@ impl OmglolClient { } } - /// OmglolClient allows you to make authenticated or unauthenticated REST API /// requests. impl OmglolClient { diff --git a/src/structures.rs b/src/structures.rs index b402d5f..b173f44 100644 --- a/src/structures.rs +++ b/src/structures.rs @@ -444,18 +444,25 @@ impl Web { #[derive(Deserialize, Debug)] pub struct WeblogEntriesResponse { + /// Status message povided by the API message: String, + + /// A vector of `WeblogEntry` structs. entries: Vec, } +/// API response for a weblog entry GET request. #[derive(Deserialize, Debug)] pub struct WeblogEntryResponse { - message: String, + /// Status message povided by the API + pub message: String, + /// Weblog entry #[serde(alias = "post")] - entry: WeblogEntry, + pub entry: WeblogEntry, } +/// A weblog entry #[derive(Deserialize, Debug)] pub struct WeblogEntry { location: String, @@ -472,25 +479,29 @@ pub struct WeblogEntry { entry_type: String, } +/// Metadata for a weblog entry. #[derive(Deserialize, Debug)] pub struct WeblogMetadata { - date: String, - slug: String, + pub date: String, + pub slug: String, } +/// API resopnse for a weblog configuration GET request. #[derive(Deserialize, Debug)] pub struct WeblogConfigurationResponse { - message: String, - configuration: WeblogConfigurationFormats, + pub message: String, + pub configuration: WeblogConfigurationFormats, } +/// Weblog configuration in different formats #[derive(Deserialize, Debug)] pub struct WeblogConfigurationFormats { - object: WeblogConfiguration, - json: String, - raw: String, + pub object: WeblogConfiguration, + pub json: String, + pub raw: String, } +/// A weblog's configuration. #[derive(Deserialize, Debug)] pub struct WeblogConfiguration { pub weblog_title: String, @@ -510,14 +521,17 @@ pub struct WeblogConfiguration { pub search_results_format: String, } +/// API response for a weblog template GET request. #[derive(Deserialize, Debug)] pub struct WeblogTemplateResponse { pub message: String, pub template: String, } +/// An HTTP request error #[derive(Debug, Clone)] pub struct RequestError { + /// HTTP status code as defined in [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). pub status_code: u16, }