Skip to content

Commit

Permalink
v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
GilOliveira committed Sep 24, 2023
1 parent 7410074 commit 0b13e33
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
[package]
name = "omglol"
authors = ["Gil Poiares-Oliveira <gil@poiares-oliveira.com>"]
version = "0.0.2"
version = "0.0.1"
edition = "2021"
repository = "https://git.sr.ht/~gpo/omglolrs"
readme = "README.md"
license = "MPL-2.0"
description = """
A wraper for api.omg.lol for your Rust masterpieces.
"""
exclude = [
".idea/",
".vscode/"
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
5 changes: 5 additions & 0 deletions src/structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use std::{collections::HashMap, error::Error, fmt, fmt::Display};
// // #[serde(default)] needs a function to be supplied.
// true

/// Response to an account GET request
#[derive(Deserialize, Debug)]
pub struct AccountResponse {
/// Status message returned by the API
Expand Down Expand Up @@ -437,6 +438,7 @@ impl ContentAsJSON for StatuslogBio {
}
}

/// Response to a POST request to the statuslog endpoint
#[derive(Deserialize, Debug)]
pub struct StatusPostResponse {
pub message: String,
Expand All @@ -446,12 +448,14 @@ pub struct StatusPostResponse {
pub external_url: String,
}

/// Profile themes
#[derive(Deserialize, Debug)]
pub struct ProfileThemes {
pub message: String,
pub themes: HashMap<String, Theme>,
}

/// omg.lol theme
#[derive(Deserialize, Debug)]
pub struct Theme {
pub id: String,
Expand All @@ -467,6 +471,7 @@ pub struct Theme {
pub sample_profile: String,
}

/// omg.lol webpage
#[derive(Serialize, Deserialize, Debug)]
pub struct Web {
pub content: String,
Expand Down
12 changes: 1 addition & 11 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use omglol::{
client::{Auth, NoAuth},
structures::{DNStype, RequestError},
structures::DNStype,
OmglolClient,
};

Expand Down Expand Up @@ -65,13 +65,3 @@ async fn get_web_page() {
let response = client.get_web_page(&address).await.unwrap().response;
println!("{:#?}", response);
}

// #[tokio::test]
// async fn query_unauthorized_endpoint() {
// let (client, _) = init_auth_client();
// let response_result = client.get_web_page("foobar")
// .await;
// let raised_error = *&dyn response_result.err().unwrap();
// assert_eq!(*raised_error.status_code, 401);
// println!("{:#?}", response_result);
// }

0 comments on commit 0b13e33

Please sign in to comment.