mangadex_api::v5::manga::manga_id::relation

Module post

Source
Expand description

Builder for creating a Manga relation.

This endpoint requires authentication.

https://api.mangadex.org/docs/swagger.html#/Manga/post-manga-relation

§Examples

use uuid::Uuid;

use mangadex_api_types::MangaRelation;
use mangadex_api::v5::MangaDexClient;
// use mangadex_api_types::{Password, Username};

let client = MangaDexClient::default();

/*

    let _login_res = client
        .auth()
        .login()
        .username(Username::parse("myusername")?)
        .password(Password::parse("hunter23")?)
        .send()
        .await?;

 */

let manga_id = Uuid::new_v4();
let target_manga_id = Uuid::new_v4();
let res = client
    .manga()
    .manga_id(manga_id)
    .relation()
    .post()
    .target_manga(target_manga_id)
    .relation(MangaRelation::SpinOff)
    .send()
    .await?;

println!("created manga relation: {:?}", res);

Structs§