~gpo/omglolrs

0b13e33c329875b37c5f39403ac243a077995f15 — Gil Poiares-Oliveira 1 year, 2 months ago 7410074 main v0.0.1
v0.0.1
4 files changed, 13 insertions(+), 13 deletions(-)

M Cargo.lock
M Cargo.toml
M src/structures.rs
M tests/integration_tests.rs
M Cargo.lock => Cargo.lock +1 -1
@@ 440,7 440,7 @@ dependencies = [

[[package]]
name = "omglol"
version = "0.0.2"
version = "0.0.1"
dependencies = [
 "dotenv",
 "email_address",

M Cargo.toml => Cargo.toml +6 -1
@@ 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


M src/structures.rs => src/structures.rs +5 -0
@@ 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


@@ 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,


@@ 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,


@@ 467,6 471,7 @@ pub struct Theme {
    pub sample_profile: String,
}

/// omg.lol webpage
#[derive(Serialize, Deserialize, Debug)]
pub struct Web {
    pub content: String,

M tests/integration_tests.rs => tests/integration_tests.rs +1 -11
@@ 1,6 1,6 @@
use omglol::{
    client::{Auth, NoAuth},
    structures::{DNStype, RequestError},
    structures::DNStype,
    OmglolClient,
};



@@ 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);
// }